Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unique id of an android activity

I need to get an unique id of an android activity instance. I'd like to take the string which the activitymanager writes in the log (for example: ActivityManager: Activity pause timeout for HistoryRecord{450495a0 ...}), but I don't know how to get it.

Does someone know how I can get this string? Or is there another unique id for each activity instance?

like image 267
anel Avatar asked Jun 19 '12 14:06

anel


2 Answers

every where in your project :

    MainActivity.class.hashCode(); 

in Activity

    this.hashCode();

You can even get hashCode from context

like image 29
Hamidreza Sadegh Avatar answered Nov 14 '22 22:11

Hamidreza Sadegh


Maybe you can use Activity's hashCode.

like image 138
Hoochwo Avatar answered Nov 14 '22 21:11

Hoochwo