android - Intent Not working in MenuInflater and with Buttons -
So I was trying to work on graphics and wanted to use intent to switch between activities and This is not the first time this but I can not really get the error, so I am posting code for my mainness and I appear here. Please tell me the reason for the problem
@Override Secure Zero to Create (Bundle Saved InstantState) {super.onCreate (SavedInstanceState); // Fullscreen Request WindowFeature (Window.FEATURE_NO_TITLE); GetWindow () SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); SetContentView (R.layout.activity_main); Button B1 = (button) Find VibibIID (R.B. button 1); Click B1.setOnClickListener (New View.OnClickListener () {@Override Public Zero (click V) {// TODO auto generated method stub intent P = new intent ("com.example.menuinflater.GFX") ; StartActivity (p);}}); }
And the manifet looks like this:
Android: allowBackup = "true" android: icon = "@ drawable / ic_launcher" Android: Labels = "@ String / app_name" Android: Theme = "@ Style / Aaptim" & gt; & Lt; Activity Android: name = ". Main Activity" Android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; Activity Android: name = "." About Android: label = "@ string / title_activity_about" Android: Theme = "@Android: Style / Theme Dialog" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.About" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; Activity Android: name = ".prefs" android: label = "@ string / title_activity_about" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.Prefs" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; Activity Android: name = ".GFX" Android: label = "@ string / title_activity_gfx" & gt; & Lt; / Activity & gt; & Lt; / Application & gt;
I hope it becomes clear where I am wrong and I want to answer with clarification. I highly appreciate the solution.
Thanks in advance!
I suggest reading. Developer. Basic training page on android.com, original and useful information in them Includes.
Regarding your specific problem, this link should help:
It should be intended:
Intention P = new intent (this, GFX.class);
Comments
Post a Comment