活动尚未开始,目前的任务已经放到了前面, [英] Activity not started, its current task has been brought to the front

查看:191
本文介绍了活动尚未开始,目前的任务已经放到了前面,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的Andr​​oid项目。我得到了以下错误 消息时,我尝试运行它。仿真器正在运行,但 应用程序不上来。我找不到任何有用的信息 线上。谁能帮我?

 警告:活动尚未开始,目前的任务已经放到了前面,
 

 公共类档案延伸活动{
        / *按钮按钮1;
        复选框CHECK1,CHECK2;
        的EditText文本1; * /

        / **第一次创建活动时调用。 * /
    @覆盖
    公共无效的onCreate(包savedInstanceState){
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.main);
     }
}
 

         

 < EditText上的android:文本=@ + ID / EditText01机器人:ID =@ + ID / EditText01
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT机器人:启用=假>< /
的EditText><复选框的android:文本=@ + ID / CheckBox03机器人:ID =@ + ID /
CheckBox03机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT>
< /复选框>
<复选框的android:文本=@ + ID / CheckBox02机器人:ID =@ + ID / CheckBox02
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT>
< /复选框>
<复选框的android:文本=@ + ID / CheckBox01机器人:ID =@ + ID / CheckBox01
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT机器人:检查=真>
< /复选框>

< / LinearLayout中>
< XML版本=1.0编码=UTF-8&GT?;
<舱单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
      包=com.seiservices.blending
      安卓版code =1
      机器人:VERSIONNAME =1.0>
    <应用机器人:图标=@可绘制/图标机器人:标签=@字符串/
APP_NAME>
        <活动机器人:个人资料NAME =
                  机器人:标签=@字符串/ APP_NAME>
            <意向滤光器>
                <作用机器人:名称=android.intent.action.MAIN/>
                <类别
机器人:名称=android.intent.category.LAUNCHER/>
                <类别
机器人:名称=android.intent.category.DEFAULT/>
            &所述; /意图滤光器>
        < /活性GT;

    < /用途>
    <使用-SDK安卓的minSdkVersion =8/>

< /舱单>
 

解决方案

这是不是一个错误信息,这是一个警告。什么系统是想告诉你:在设备上的应用程序是一样的Eclipse的应用程序。而且,由于应用程序已经在设备上运行时,系统会告诉你,它不会杀死并重新启动它,而是把你已经在运行的应用程序的活动推向了前台。这是pretty的正常。 ; - )

如果您编辑code和运行它警告不会继续(因为该应用程序,然后杀了,重新安装和重新启动),或者如果你杀了你的程序在手机上,如:通过DDMS。

I have a very simple android project. I got the following error message when I try to run it. The emulator is running but the application doesn't come up. I couldn't find any useful information online. Can anyone help me?

Warning: Activity not started, its current task has been brought to the front

public class Profile extends Activity {
        /*Button button1;
        CheckBox check1, check2;
        EditText text1;*/

        /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
     }
}

<EditText android:text="@+id/EditText01" android:id="@+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:enabled="false"></
EditText><CheckBox android:text="@+id/CheckBox03" android:id="@+id/
CheckBox03" android:layout_width="fill_parent"
android:layout_height="wrap_content">
</CheckBox>
<CheckBox android:text="@+id/CheckBox02" android:id="@+id/CheckBox02"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</CheckBox>
<CheckBox android:text="@+id/CheckBox01" android:id="@+id/CheckBox01"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:checked="true">
</CheckBox>

</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.seiservices.blending"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name=".Profile"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
                <category
android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

    </application>
    <uses-sdk android:minSdkVersion="8" />

</manifest> 

解决方案

It is not an error message, it is a warning. What the system is trying to tell you: The application on the device is the same as your application in Eclipse. And because the application is already running on the device, the system tells you that it is not going to kill and restart it, but bring the activity of your already running app into the foreground. This is pretty normal. ;-)

The warning will not continue if you edit your code and run it (because the app is then killed, reinstalled and started) or if you kill your process on the phone, e.g. via the DDMS.

这篇关于活动尚未开始,目前的任务已经放到了前面,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆