So, I'm kind of a noob in Android but I searched a lot for this and I was not able to find a solution:
In my navigation drawer, each row opens a new intent. How can I check if a certain intent is open/active so that I'll use that instead of creating a new one?
I tried using this solution:
But my issue is that the drawer opens the same class everytime, but each class has different "extras." For example:
public void itemClicked(View view, int position) {
Intent intent=null;
switch (position) {
case 1:
intent = new Intent(getActivity(), DisplayActivity.class);
intent.putExtra("ARGUMENT","SECTION 1");
break;
case 2:
intent = new Intent(getActivity(), DisplayActivity.class);
intent.putExtra("ARGUMENT","SECTION 2");
break;
case 3:
intent = new Intent(getActivity(), DisplayActivity.class);
intent.putExtra("ARGUMENT","SECTION 3");
break;
}
startActivity(intent);
}
How can I check if an intent with that class and with those extras is already open?
Thanks!