Wednesday, 15 April 2015

Android Multiple Activites -


I'm new to Android development I am using and trying to combine these 2 projects into a single project I'd like to "use the identity demo", which gives additional functionality to the SD card of the copy property. I did duplicate java files from "AssentActionDemon" with what I did "AssetToSaDard". Then I added the following line to the IntentActionDemo manifest:

  & amp; Activity Activity: Name = "Main Activity" & gt; & Lt; / Activity & gt;   

However, the files will not be copied to the SD card. If I replace "main activity" as an "interaction domo", then the file will be copied to the SD card.

  & lt; Activity Android: name = ". IntentActionDemo" 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;   

It seems that in order to use the copy property for the SD card, I have to keep it as the first activity and have to intend. Action.MAIN as well as intent.category.LAUNCHER

If I want IntentActionDemo as the first activity, then what should I do IntentA as the third activity and the main activity (AssetsTOSD card)? For the first time, I would like to automatically copy the SD card copy files at startup, but do not click on it.

You should place it in your AndroidManifest.xml code:

  & Lt; Activity Android: name = ". IntentActionDemo" 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 = "main activity" & gt; & Lt; / Activity & gt; & Lt; Activity Android: name = ". IntentA" & gt; & Lt; / Activity & gt;   

and in IntentA.java change

  intent = new intent (this, IntentActionDemo.class);   

to

  intent = new intent (this, MainActivity.class);   

For more information on Android API Guides and perhaps you might also get useful descriptions.

No comments:

Post a Comment