运行程序时Warning

运行程序时提出了这个一个警告:Activity not started, its current task has been brought to the front 

package ying.android;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

public class Activity01 extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TextView myTextView = (TextView)findViewById(R.id.myText) ; 
        Button myButton = (Button)findViewById(R.id.myButton) ; 
        myTextView.setText("My first activity:") ; 
        myButton.setText("My first button test.") ; 
    }
}

这应该是你的模拟器中还有东西在运行,也就是你要运行的activity已经有一个在模拟器中运行了。
不要以为你的模拟器退出到桌面了就没有东西在跑了。在你调试的时候异常关闭的程序有可能就有activity在运行。

解决方法project->clean。 应该就OK了


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值