1. Network unavailable: Permission denied (maybe missing Internet permission)
InAndroidAdded the allowed Network option in mainifest. XML (after the end tag> ):
<Uses-Permission Android: Name = "android. Permission. Internet"/>
2. Activity Class not found: Android. content. activitynotfoundexception: unable to find explicit activity class {XXXX}
Add the Activity Statement in androidmainifest. XML, for example:
<Activity Android: Name = ". xxxactivity">
</Activity>
3. Why can't I find the startsubactivity method?
Now, use the startactivityforresult method to replace the old startsubactivity method.
4. View in XML cannot be loaded, and a java. Lang. nullpointerexception exception is reported.
Forget to load the layout file of the activity:
Setcontentview (R. layout. Main );
5. unparsed aapt error (s )! Check the console for output
If you cannot find an error or cannot understand the error on the console, click Project ---------> clean ....
6. Differences between requestcode and resultcode
When startactivityforresult () and onactivityresult () are used, requestcode and resultcode are used respectively. Sometimes, it is very easy to confuse the two parameters.
The obfuscation between requestcode and resultcode is incorrect. Startactivityforresult, you can use onactivityresult () to distinguish the data returned by a sub-module. for Java, D, and even e sub-modules, it is better to separate different requestcodes for each partition. Setresut (INT resultcode, intent) resultcode if the B submodule may return several different results, you can use this parameter for identification and differentiation. There is also a special result_ OK value here, it is good to use it without special circumstances, the SDK has instructions, ah. Intent will not be explained. The onactivityresult () onactivityresult (INT requestcode, int resultcode, intent) returned to a will not be explained here. If you do not distinguish requestcode from resultcode, there will be no difference as long as other activities setresult reach a onactivityresult.
7. Files cannot be downloaded to the SD card.
Add <uses-Permission Android: Name = "android. Permission. write_external_storage"/> to the manifest file.
8. Center the control in the parent container:
Android: layout_gravity = "center_vertical"
Http://www.getcn.net/index.php? MoD = Skill & Action = detail & id = 43943