error!求解~~~~ 本帖最后由 zhq56030207 于 2010-12-24 18:52:38 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 导入的这个包是否存在,LaunchPerformanceBase的父类是什么,是不是activity. // Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.// Jad home page: http://kpdus.tripod.com/jad.html// Decompiler options: packimports(3) // Source File Name: LaunchPerformanceBase.javapackage android.test;import android.app.Instrumentation;import android.content.Intent;import android.os.*;import android.view.IWindowManager;public class LaunchPerformanceBase extends Instrumentation{ public LaunchPerformanceBase() { mResults = new Bundle(); mIntent = new Intent("android.intent.action.MAIN"); mIntent.setLaunchFlags(4); mWindowManager = android.view.IWindowManager.Stub.asInterface(ServiceManager.getService("window")); } protected void LaunchApp() { long start = 0L; long end = 0L; try { mWindowManager.setAnimationScale(0.0F); } catch(DeadObjectException e) { } if(!isProfiling()) { startAllocCounting(); start = System.currentTimeMillis(); } startActivitySync(mIntent); waitForIdleSync(); if(!isProfiling()) { end = System.currentTimeMillis(); stopAllocCounting(); mResults.putLong("time", Long.valueOf(end - start)); getAllocCounts(mResults); } try { mWindowManager.setAnimationScale(1.0F); } catch(DeadObjectException e) { } } public static final String LOG_TAG = "Launch Performance"; protected Bundle mResults; protected Intent mIntent; private IWindowManager mWindowManager;}有这个class吧?manifest中设置了测试可以参考这个教程,不知楼主看过了没。Android单元测试关键字: camera unit test http://mintelong.javaeye.com/blog/460903 1. package com.android.camera; 2. 3. import android.app.Activity; 4. import android.os.Bundle; 5. import android.test.LaunchPerformanceBase; 6. 7. /** 8. * Instrumentation class for Camera launch performance testing. 9. */ 10. public class CameraLaunchPerformance extends LaunchPerformanceBase { 11. 12. public static final String LOG_TAG = "CameraLaunchPerformance"; 13. 14. public CameraLaunchPerformance() { 15. super(); 16. } 17. 18. @Override 19. public void onCreate(Bundle arguments) { 20. super.onCreate(arguments); 21. 22. mIntent.setClassName(getTargetContext(), "com.android.camera.Camera"); 23. start(); 24. } 25. 26. /** 27. * Calls LaunchApp and finish. 28. */ 29. @Override 30. public void onStart() { 31. super.onStart(); 32. LaunchApp(); 33. finish(Activity.RESULT_OK, mResults); 34. } 35. } 红色部分报错~~~ Intent mIntent=new Intent(); mIntent.setClassName(getTargetContext(), "com.android.camera.Camera"); 就ok了 但是LaunchApp(); finish(Activity.RESULT_OK, mResults); 这个该怎么办? 现在出现的问题是 No tests found with test runner 'JUnit 3'该怎么解决呢? openFileDescriptor 时出现问题啦 在线求解 用jquery开发的安卓应用,关于安卓上下左右键盘键值控制 关于android中ListView使用的问题 linux下android开发,eclipse找不到手机设备 电容屏触摸不是很准 问题 android sax解析疑问??? 怎样通过pc给联通号发信息? android 屏幕旋转 android 获取某个布局控件 添加到另一个布局中 关于android的activity的启动模式 怎样像闹钟一样在唤醒机器后,让activity出现在锁屏画面前 我的android没错,怎么就是运行不出结果呢?
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: LaunchPerformanceBase.javapackage android.test;import android.app.Instrumentation;
import android.content.Intent;
import android.os.*;
import android.view.IWindowManager;public class LaunchPerformanceBase extends Instrumentation
{ public LaunchPerformanceBase()
{
mResults = new Bundle();
mIntent = new Intent("android.intent.action.MAIN");
mIntent.setLaunchFlags(4);
mWindowManager = android.view.IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
} protected void LaunchApp()
{
long start = 0L;
long end = 0L;
try
{
mWindowManager.setAnimationScale(0.0F);
}
catch(DeadObjectException e) { }
if(!isProfiling())
{
startAllocCounting();
start = System.currentTimeMillis();
}
startActivitySync(mIntent);
waitForIdleSync();
if(!isProfiling())
{
end = System.currentTimeMillis();
stopAllocCounting();
mResults.putLong("time", Long.valueOf(end - start));
getAllocCounts(mResults);
}
try
{
mWindowManager.setAnimationScale(1.0F);
}
catch(DeadObjectException e) { }
} public static final String LOG_TAG = "Launch Performance";
protected Bundle mResults;
protected Intent mIntent;
private IWindowManager mWindowManager;
}有这个class吧?
manifest中设置了测试可以参考这个教程,不知楼主看过了没。
Android单元测试
关键字: camera unit test
http://mintelong.javaeye.com/blog/460903
2.
3. import android.app.Activity;
4. import android.os.Bundle;
5. import android.test.LaunchPerformanceBase;
6.
7. /**
8. * Instrumentation class for Camera launch performance testing.
9. */
10. public class CameraLaunchPerformance extends LaunchPerformanceBase {
11.
12. public static final String LOG_TAG = "CameraLaunchPerformance";
13.
14. public CameraLaunchPerformance() {
15. super();
16. }
17.
18. @Override
19. public void onCreate(Bundle arguments) {
20. super.onCreate(arguments);
21.
22. mIntent.setClassName(getTargetContext(), "com.android.camera.Camera");
23. start();
24. }
25.
26. /**
27. * Calls LaunchApp and finish.
28. */
29. @Override
30. public void onStart() {
31. super.onStart();
32. LaunchApp();
33. finish(Activity.RESULT_OK, mResults);
34. }
35. }
红色部分报错~~~
mIntent.setClassName(getTargetContext(), "com.android.camera.Camera"); 就ok了
但是
LaunchApp();
finish(Activity.RESULT_OK, mResults); 这个该怎么办?