In my application, I am getting an activity timeout in a event listener of a button. Here is the code of the onclick event listener. When I press the button activity is timed out.
btn_process_job.setOnClickListener(m2AddListener);
private OnClickListener m2AddListener = new OnClickListener()
{
public void onClick(View v)
{
Bundle extras = getIntent().getExtras();
if(extras !=null) {
String fileName = extras.getString("file_name");
}
}
};
The parameters are set in another activity as
Intent i = new Intent(CameraPreview.this, InitProgram.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra("file_name", mLocation.getName());
startActivityForResult(i, 1);
How do I fix this problem?
Try this: