0

通过将其更改为“this”(最初不是双关语),我能够编译我的 Activity 代码:

public class OnDemandAndAutomatic_Activity extends Activity implements View.OnClickListener {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ondemandandautomatic_activity);

        Button buttonAuthorizeUsers = (Button) findViewById(R.id.buttonAuthorizeUsers);
        buttonAuthorizeUsers.setOnClickListener(this); // <- this is different
}

    @Override
    public void onClick(View v) {
        Intent configure = new  Intent(OnDemandAndAutomatic_Activity.this, Configure_Activity.class);  
        OnDemandAndAutomatic_Activity.this.startActivity(configure);
    }

...但它在进入第一个 Activity 后立即进入调试器(我得到一个 ActivityThread.perfo 选项卡,上面写着“找不到源”);LogCat 发出这些错误,这些错误似乎对我的应用程序没有任何意义(但“启动核心服务失败”看起来特别不祥,乍一看):

01-28 17:02:40.453: E/Zygote(33): setreuid() failed. errno: 2
01-28 17:02:49.863: E/Zygote(33): setreuid() failed. errno: 17
01-28 17:02:51.273: E/BatteryService(61): usbOnlinePath not found
01-28 17:02:51.273: E/BatteryService(61): batteryVoltagePath not found
01-28 17:02:51.273: E/BatteryService(61): batteryTemperaturePath not found
01-28 17:02:51.283: E/SurfaceFlinger(61): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
01-28 17:02:51.433: E/SensorService(61): couldn't open device for module sensors (Invalid argument)
01-28 17:02:56.993: E/System(61): Failure starting core service
01-28 17:02:56.993: E/System(61): java.lang.SecurityException
01-28 17:02:56.993: E/System(61):   at android.os.BinderProxy.transact(Native Method)
01-28 17:02:56.993: E/System(61):   at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
01-28 17:02:56.993: E/System(61):   at android.os.ServiceManager.addService(ServiceManager.java:72)
01-28 17:02:56.993: E/System(61):   at com.android.server.ServerThread.run(SystemServer.java:207)
01-28 17:02:57.013: E/EventHub(61): could not get driver version for /dev/input/mouse0, Not a typewriter
01-28 17:02:57.013: E/EventHub(61): could not get driver version for /dev/input/mice, Not a typewriter
01-28 17:02:57.303: E/SoundPool(61): error loading /system/media/audio/ui/Effect_Tick.ogg
01-28 17:02:57.303: E/SoundPool(61): error loading /system/media/audio/ui/KeypressStandard.ogg
01-28 17:02:57.303: E/SoundPool(61): error loading /system/media/audio/ui/KeypressSpacebar.ogg
01-28 17:02:57.303: E/SoundPool(61): error loading /system/media/audio/ui/KeypressDelete.ogg
01-28 17:02:57.313: E/SoundPool(61): error loading /system/media/audio/ui/KeypressReturn.ogg
01-28 17:02:58.023: E/ThrottleService(61): Could not open GPS configuration file /etc/gps.conf
01-28 17:03:00.983: E/logwrapper(163): executing /system/bin/tc failed: No such file or directory
01-28 17:03:01.063: E/logwrapper(164): executing /system/bin/tc failed: No such file or directory
01-28 17:03:01.083: E/logwrapper(165): executing /system/bin/tc failed: No such file or directory
4

0 回答 0