本文整理汇总了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);
}