本文整理匯總了Java中android.app.Activity.hashCode方法的典型用法代碼示例。如果您正苦於以下問題:Java Activity.hashCode方法的具體用法?Java Activity.hashCode怎麽用?Java Activity.hashCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.app.Activity
的用法示例。
在下文中一共展示了Activity.hashCode方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: finishActivitySync
import android.app.Activity; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
static public void finishActivitySync(Activity activity, Instrumentation instrumentation, boolean doFinish)
{
if (doFinish)
activity.finish();
//give activity one minute to finish
long currentTime = System.currentTimeMillis();
boolean finishTimeout = false;
int activityHash = activity.hashCode();
boolean isDestroyed = false;
while (!isDestroyed && !finishTimeout) {
instrumentation.waitForIdleSync();
finishTimeout = (System.currentTimeMillis() - currentTime) > 140000;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
isDestroyed = activity.isDestroyed();
}else {
isDestroyed = (Boolean)callMethod(null, activity.getWindow(), "isDestroyed", null);
}
}
if (finishTimeout) {
WebtrekkLogging.log("finishActivitySync: finished by timeout. Hash:" + activityHash);
}
}
示例2: onActivityCreated
import android.app.Activity; //導入方法依賴的package包/類
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
Log.w(TAG, activity.getClass().getName() + "@" + activity.hashCode() + " " + activity.getTaskId() + " " + " onActivityCreated");
TaskInfo taskInfo = new TaskInfo(activity.getTaskId(), activity.hashCode(), activity.getClass().getSimpleName());
taskInfo.setOnCreate(true);
qhandler.add(taskInfo);
}