这个在虚拟机上可以运行,可到了真机上就意外终止
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;public class LuyinActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("audio/amr");
intent.setClassName("com.android.soundrecorder","com.android.soundrecorder.SoundRecorder");
startActivity(intent);
}
}
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;public class LuyinActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("audio/amr");
intent.setClassName("com.android.soundrecorder","com.android.soundrecorder.SoundRecorder");
startActivity(intent);
}
}
08-11 11:12:07.448: ERROR/AndroidRuntime(29621): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.suen/com.suen.LuyinActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.soundrecorder/com.android.soundrecorder.SoundRecorder}; have you declared this activity in your AndroidManifest.xml?
<uses-permission android:name="android.permission.RECORD_AUDIO"></uses-permission>
比如像这样的<activity android:name=".HelloSeekBar"></activity>
08-11 11:45:45.809: ERROR/wpa_supplicant(1479): wpa_driver_tista_get_rssi data -62 beacon -60 success
08-11 11:45:48.820: ERROR/wpa_supplicant(1479): wpa_driver_tista_get_rssi data -62 beacon -59 success
08-11 11:45:51.823: ERROR/wpa_supplicant(1479): wpa_driver_tista_get_rssi data -62 beacon -60 success
08-11 11:45:54.839: ERROR/wpa_supplicant(1479): wpa_driver_tista_get_rssi data -62 beacon -59 success
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): FATAL EXCEPTION: main
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.suen/com.suen.LuyinActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.soundrecorder/com.android.soundrecorder.SoundRecorder}; have you declared this activity in your AndroidManifest.xml?
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2668)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2684)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.app.ActivityThread.access$2300(ActivityThread.java:126)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.os.Handler.dispatchMessage(Handler.java:99)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.os.Looper.loop(Looper.java:123)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.app.ActivityThread.main(ActivityThread.java:4632)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at java.lang.reflect.Method.invokeNative(Native Method)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at java.lang.reflect.Method.invoke(Method.java:521)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at dalvik.system.NativeStart.main(Native Method)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.soundrecorder/com.android.soundrecorder.SoundRecorder}; have you declared this activity in your AndroidManifest.xml?
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.app.Activity.startActivityForResult(Activity.java:2817)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.app.Activity.startActivity(Activity.java:2923)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at com.suen.LuyinActivity.onCreate(LuyinActivity.java:17)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2632)
08-11 11:45:54.941: ERROR/AndroidRuntime(31234): ... 11 more
08-11 11:45:56.019: ERROR/(1543): onResume() check 2, mRestoring : false
08-11 11:45:57.847: ERROR/wpa_supplicant(1479): wpa_driver_tista_get_rssi data -62 beacon -58 success
08-11 11:46:00.855: ERROR/wpa_supplicant(1479): wpa_driver_tista_get_rssi data -62 beacon -61 success