仿真器不会重新加载代码

时间:2013-05-17 22:26:13

标签: android-intent

  1. 这是我的代码

    public class MainActivity extends Activity {
    Button btn;
    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn = (Button) findViewById(R.id.button1);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,
                        socialnetworking.class);
                startActivity(intent);    
            }
        });    
    }    
    

    }

  2. 但我从我的控制台收到此消息:

        [2013-05-17 17:57:44 - NXTRemoteControl] ------------------------------
        [2013-05-17 17:57:44 - NXTRemoteControl] Android Launch!
        [2013-05-17 17:57:44 - NXTRemoteControl] adb is running normally.
        [2013-05-17 17:57:44 - NXTRemoteControl] Performing com.example.nxtremotecontrol.MainActivity activity launch
        [2013-05-17 17:57:44 - NXTRemoteControl] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'GalaxyNexus'
        [2013-05-17 17:57:46 - NXTRemoteControl] Application already deployed. No need to reinstall.
        [2013-05-17 17:57:46 - NXTRemoteControl] Starting activity com.example.nxtremotecontrol.MainActivity on device emulator-5554
        [2013-05-17 17:57:47 - NXTRemoteControl] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.nxtremotecontrol/.MainActivity }
        [2013-05-17 17:57:47 - NXTRemoteControl] ActivityManager: Warning: Activity not started, its current task has been brought to the front
    
    1. 我对它的含义感到有些困惑,因为它被带到了前面,整个事情就这样了。

1 个答案:

答案 0 :(得分:0)

模拟器只是告诉你

  1. 您的应用已经在“设备”
  2. 无法检测到任何明显的变化
  3. 它已经在运行,因此它只需要被带到前面
  4. 如果您需要刷新它,可以

    • 卸载并重新开始运行
    • 更改它并再次开始运行 或
    • 清理项目并重新开始运行