当我在手机中运行代码时,它没有运行.我担心它.无法弄清楚问题是什么.我有5个Java文件(我不知道我是否可以将其称为活动)MainActivity.java,MainActivity2.java,Person.java,DatabaseHandler. java,GetDetails.java.和activity_main.xml,front_page.xml,refer_mail.xml
它的篇幅很长.对此表示抱歉.
这是我的控制台消息.
[2015-08-28 19:23:58 - FormDetails] ActivityManager: Error type 3
[2015-08-28 19:23:58 - FormDetails] ActivityManager: Error: Activity class {com.Prasad.formdetails/com.Prasad.formdetails.MainActivity} does not exist.
这是我的MainActivity.java文件.
package com.Prasad.formdetails;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button register=(Button)findViewById(R.id.register);
Button details=(Button)findViewById(R.id.get_details);
//Register Functionality
register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(MainActivity.this, MainActivity2.class);
startActivity(intent);
}
});
//Get Details Functionality
details.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent=new Intent(MainActivity.this, GetDetails.class);
startActivity(intent);
}
});
}
}
这是我的AndroidManifest文件
package="com.Prasad.formdetails"
android:versionCode="1"
android:versionName="1.0" >
android:minSdkVersion="14"
android:targetSdkVersion="23" />
android:allowBackup="true"
android:enabled="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name=".MainActivity"
android:label="@string/app_name" >