java - ActivityManager : Warning: Activity not started, 它当前的任务已被带到前面。我读过的所有相关答案都没有成果。

标签 java android xml eclipse android-manifest

我尝试编辑代码,因为它会在模拟器上重新安装应用程序,但我一次又一次遇到相同的错误。

它表示编辑源查找路径并显示一个按钮。

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/images"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/textView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Enter the text here"
        android:textColor="#000000"
        android:textSize="30dp" />

    <EditText
        android:id="@+id/textReader"
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:inputType="textMultiLine"
         />

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <Button
            android:id="@+id/startReading"
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="Start reading"
            android:textSize="15dp" />

        <Button
            android:id="@+id/clearBox"
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="Clear Box"
            android:textSize="15dp" />
    </LinearLayout>


    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <RelativeLayout
            android:id="@+id/relativeLayout1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="7.58" >
        </RelativeLayout>
    </LinearLayout>

    <EditText
        android:id="@+id/textDisplay"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</LinearLayout>

这是上面的 main.xml 文件。

package a.fr.read;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class FastreaderActivity extends Activity {
    /** Called when the activity is first created. */
    Button startReading,clearBox;
    EditText textReader;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        startReading=(Button)findViewById(R.id.textReader); 
        clearBox=(Button)findViewById(R.id.textReader);
        textReader=(EditText) findViewById(R.id.textReader);
        clearBox.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                textReader.setText("");
            }
        });
        startReading.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub

            }
        });
    }
}

这是java代码。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="a.fr.read"
    android:versionCode="1"
    android:versionName="1.0" >

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

    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name" >
        <activity
            android:name=".FastreaderActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

这就是 Android list 文件。

最佳答案

首先清理您的项目并刷新该项目(在 Eclipse- Project-clean 中)进行刷新(转到该项目名称(ListVeiwdemo),然后右键单击并出现刷新选项。)

关于java - ActivityManager : Warning: Activity not started, 它当前的任务已被带到前面。我读过的所有相关答案都没有成果。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22322709/

相关文章:

java - LibGDX/Box2D UnsatisfiedLinkError

php - ANDROID&PHP - 如何使用 PHP 从 MySql 显示 JSONArray

java - Parse.com 推送通知不起作用

java - 如何在不使用 javascript 的情况下在 sightly 页面中使用 sling 服务?

java - 如何编写哈希的删除方法来删除值?

java - web.xml 忽略主 JSP 文件

使用 Powershell 将 XML 转为哈希表

javascript - 使用正则表达式修改xml文件

java - 您能否保持对象在 Java Swing 面板上的位置?

java - 将 JSON 转换为对象会引发 JsonMappingException "Can not deserialize instance of class out of START_ARRAY token"