Reputation: 111
My problem is: I would give a unique ID to each activity for each existing (noy only active one) application on the android phone. Have you any idea how? (sorry for my English im French...)
Upvotes: 0
Views: 51
Reputation: 14622
As Dheeraj said: "You probably meant the ComponentName". ComponentName is:
Identifier for a specific application component (Activity, Service, BroadcastReceiver, or ContentProvider) that is available. Two pieces of information, encapsulated here, are required to identify a component: the package (a String) it exists in, and the class (a String) name inside of that package.
Now, you can create an object that contains Package name(unique to the application) + class name (unique to activity). So the credit goes to Dheeraj.
Upvotes: 1
Reputation: 13062
If your goal is to start an Activity, then you can do this:
Intent i = new Intent(context, MyActivity.class);
startActivity(i);
Upvotes: 1