虽然我在Manifest文件中注册了Activity类,但我收到了ActivityNotFoundException。 你能帮帮我吗...
谢谢..
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name="Login"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Registration" android:label="Registration"
></activity>
<activity android:name=".Dashboard" android:label="Dashboard"
></activity>
<activity android:name="com.innominds.BillDetails"
></activity>
</application>
这是清单文件。
现在我为BillDetails类编写了以下代码
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
public class BillDetails extends FragmentActivity
{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.details_bill);
}
public static class BillSearch extends Fragment
{
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
return inflater.inflate(R.layout.billsearch, container, false);
}
public void onActivityCreated(Bundle savedState)
{
super.onActivityCreated(savedState);
}
}
public static class DetailBill extends Fragment
{
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
return inflater.inflate(R.layout.billdetails, container, false);
}
public void onActivityCreated(Bundle savedState)
{
super.onActivityCreated(savedState);
}
}
}
答案 0 :(得分:1)
您的活动是否与应用程序包不同?如果是,则在清单文件中输入活动的完整包名。
答案 1 :(得分:1)
<activity android:name="yourPackage.YourActivity" />