5

I have a Gridview with images in Fragment on my FragmentActivity.

Gridview onItemClick I call Activity

Intent intent = new Intent(getSherlockActivity(), ViewActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                intent.putExtra("PREVIEW_IMG_ID", imagesIDs.get(pos));
                startActivity(intent);  

On first ViewActivity backpressed all seems normal but second click Gridview onItemClick and ViewActivity backpressed returns error when I set Strict mode:

StrictMode ViewActivity; instances=2; limit=1 and app died.

Why that happen? Can I prevent error or just ignore ?

View Activity

import android.app.Activity;
import android.os.Bundle;

import com.bugexplorer.wallpapers.R;

public class ViewActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view);

    }     

}
Sever
  • 2,338
  • 5
  • 35
  • 55
  • I think you might be leaking your activity... – Zharf Oct 31 '13 at 14:10
  • @Zharf. Thank you. But my activity empty. Just Created. Nothing insert. I just update mu question with ViewActivity code. – Sever Oct 31 '13 at 14:15
  • maybe this answer has some insight to your problem http://stackoverflow.com/a/16858074/857853 ... also check if that onCreate is called multiple times – Zharf Oct 31 '13 at 14:30

0 Answers0