08-14 06:33:17.728: ERROR/Zygote(33): setreuid() failed. errno: 2
08-14 06:33:27.557: ERROR/Zygote(33): setreuid() failed. errno: 17
08-14 06:33:29.068: ERROR/BatteryService(59): usbOnlinePath not found
08-14 06:33:29.068: ERROR/BatteryService(59): batteryVoltagePath not found
08-14 06:33:29.068: ERROR/BatteryService(59): batteryTemperaturePath not found
08-14 06:33:29.087: ERROR/SurfaceFlinger(59): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
08-14 06:33:36.137: ERROR/EventHub(59): could not get driver version for /dev/input/mouse0, Not a typewriter
08-14 06:33:36.137: ERROR/EventHub(59): could not get driver version for /dev/input/mice, Not a typewriter
08-14 06:33:36.688: ERROR/System(59): Failure starting core service
08-14 06:33:36.688: ERROR/System(59): java.lang.SecurityException
08-14 06:33:36.688: ERROR/System(59):     at android.os.BinderProxy.transact(Native Method)
08-14 06:33:36.688: ERROR/System(59):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
08-14 06:33:36.688: ERROR/System(59):     at android.os.ServiceManager.addService(ServiceManager.java:72)
08-14 06:33:36.688: ERROR/System(59):     at com.android.server.ServerThread.run(SystemServer.java:184)
08-14 06:33:38.017: ERROR/SoundPool(59): error loading /system/media/audio/ui/Effect_Tick.ogg
08-14 06:33:38.017: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressStandard.ogg
08-14 06:33:38.028: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressSpacebar.ogg
08-14 06:33:38.037: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressDelete.ogg
08-14 06:33:38.057: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressReturn.ogg
08-14 06:33:40.739: ERROR/ThrottleService(59): Could not open GPS configuration file /etc/gps.conf
08-14 06:33:42.358: ERROR/logwrapper(150): executing /system/bin/tc failed: No such file or directory
08-14 06:33:42.507: ERROR/logwrapper(151): executing /system/bin/tc failed: No such file or directory
08-14 06:33:42.617: ERROR/logwrapper(152): executing /system/bin/tc failed: No such file or directory
08-14 06:33:56.667: ERROR/HierarchicalStateMachine(59): TetherMaster - unhandledMessage: msg.what=3

解决方案 »

  1.   

    public class MainActivity extends Activity { Button m_Button1,m_Button2;

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            
            m_Button1 = (Button)findViewById(R.id.Button1);
            m_Button2 = (Button)findViewById(R.id.Button2);
            
            m_Button1.setText("开始");
            m_Button2.setText("退出");
            
            m_Button1.setWidth(150);
            m_Button2.setWidth(100);
            
            m_Button1.setTextColor(Color.GREEN);
            m_Button2.setTextColor(Color.RED);
            
            m_Button1.setTextSize(30);
            m_Button2.setTextSize(20);
            
            m_Button1.setOnClickListener(new Button.OnClickListener(){
             public void onClick(View v){
             Toast toast = Toast.makeText(MainActivity.this, "你点击了“"+m_Button1.getText()+"”按钮!", Toast.LENGTH_LONG);
             toast.setGravity(Gravity.TOP, 0, 150);
             toast.show();
             }
            });
            
            m_Button2.setOnClickListener(new Button.OnClickListener(){
             public void onClick(View v){
             MainActivity.this.finish();
             }
            });
        }    @Override
        public boolean onCreateOptionsMenu(Menu menu) {
            return true;
        }    
        @Override
        public boolean onOptionsItemSelected(MenuItem item) {
            switch (item.getItemId()) {
                case android.R.id.home:
                    NavUtils.navigateUpFromSameTask(this);
                    return true;
            }
            return super.onOptionsItemSelected(item);
        }
    }就这一个class了.
      

  2.   

    经测试Button部分的功能正常,就是不知道你下面两个Override的是干嘛的,如果是按钮部分出错,怀疑你是在布局文件那搞错了
      

  3.   

    没看出啥错误,唯一的一个地方@Override
      public boolean onCreateOptionsMenu(Menu menu) {
      return true;
      }
    里面怎么没有设置menu
      

  4.   

    终于解决了   原来是AndroidManifest.xml文件里加一个<intent-filter>就行了