Unable to set focus in editText
Budget: ₹100 – ₹400 INR
After tapping the button, I am trying to set focus in edit text.
Due to some reasons, it is not working. Here is the code below
btnscan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.gamma.scan");
if (launchIntent != null) {
try{
startActivity(launchIntent);
txtUPC.requestFocus();
}catch(Exception e){
e.printStackTrace();
}
}
}
});
Due to some reasons, it is not working. Here is the code below
btnscan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.gamma.scan");
if (launchIntent != null) {
try{
startActivity(launchIntent);
txtUPC.requestFocus();
}catch(Exception e){
e.printStackTrace();
}
}
}
});