-1

现在我正在尝试在屏幕上显示一些文本,但我的项目没有启动,我找不到准确的原因。有人遇到过这种情况吗?

在这里,我已经详细地为您提供了所有内容供您参考。请在下面找到

LOGCAT

08-13 16:02:58.823: D/AndroidRuntime(336): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
08-13 16:02:58.823: D/AndroidRuntime(336): CheckJNI is ON
08-13 16:02:58.953: D/AndroidRuntime(336): --- registering native functions ---
08-13 16:02:59.483: D/AndroidRuntime(336): Shutting down VM
08-13 16:02:59.483: D/dalvikvm(336): Debugger has detached; object registry had 1 entries
08-13 16:02:59.522: I/AndroidRuntime(336): NOTE: attach of thread 'Binder Thread #3' failed

安慰

[2012-08-13 15:50:55 - print_testing] ------------------------------
[2012-08-13 15:50:55 - print_testing] Android Launch!
[2012-08-13 15:50:55 - print_testing] adb is running normally.
[2012-08-13 15:50:55 - print_testing] No Launcher activity found!
[2012-08-13 15:50:55 - print_testing] The launch will only sync the application package on the device!
[2012-08-13 15:50:55 - print_testing] Performing sync
[2012-08-13 15:50:55 - print_testing] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'Android22-API-8'
[2012-08-13 15:50:56 - print_testing] Application already deployed. No need to reinstall.
[2012-08-13 15:50:56 - print_testing] \print_testing\bin\print_testing.apk installed on device
[2012-08-13 15:50:56 - print_testing] Done!

显示活动.java

public class DisplayActivity extends Activity
{   
EditText edt1,edt2;
Button btn;

@Override
public void onCreate(Bundle savedInstanceState) 
{

super.onCreate(savedInstanceState);
setContentView(R.layout.main1);


edt1 = (EditText)findViewById(R.id.editText1); 
edt2 = (EditText)findViewById(R.id.editText2);

Button btn = (Button)findViewById(R.id.button1);
btn.setOnClickListener(new View.OnClickListener() 

{

@Override
public void onClick(View v) 
{

if(edt1.getText().toString().equals("4545"))
{

String newLine = System.getProperty("line.separator");
System.out.println("Student name : Karan" + newLine + "Total no of Working days : 25" 
+ newLine +"Total no of present days : 23 " + newLine + "Total no of Absent days : 2");
        }
    }
});
 }
}

AndroidManifest.XML

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

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

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name">
    <activity
        android:name=".DisplayActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN1" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

    </activity>
</application>

</manifest>
4

2 回答 2

4

检查您的 AndroidManifest.xml 。它不是

<action android:name="android.intent.action.MAIN1" />

它应该是

<action android:name="android.intent.action.MAIN" />
于 2012-08-13T10:47:35.600 回答
1

你的 AndroidManifest.xml 文件应该包含这个而不是 "MAIN1" main is action not a xml

于 2012-08-13T11:01:12.873 回答