这个在虚拟机上可以运行,可到了真机上就意外终止
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);
        
    }
}

解决方案 »

  1.   


    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?
      

  2.   

    好像已经给了错误提示了呀。have you declared this activity in your AndroidManifest.xml?
      

  3.   

    我在AndroidManifest.xml中加入这句话后,真机也运行不起
    <uses-permission android:name="android.permission.RECORD_AUDIO"></uses-permission>
      

  4.   

    你加的是权限, 报的是你没activity 没有注册
    比如像这样的<activity android:name=".HelloSeekBar"></activity>
      

  5.   

    你的固件,好像没有 com.android.soundrecorder/com.android.soundrecorder.SoundRecorder 这个东西,造成的,他自己的activity倒是有,你在模拟器跑下看看,你用的是什么手机
      

  6.   

    这个activity已经注册过了,我把这句加上后程序就没有了相应
      

  7.   

    这是再真机上的logcat
    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
      

  8.   

    Samsung的i9003(Galaxy SL)  GT-I9003,android 2.2.1你说的什么意思我不太明白,能详细点么?谢谢
      

  9.   

    你手机固件可能不带这个系统默认录音程序,所以无法调用,你的程序在android模拟器中试下