I've been trying to implement the tab UI described in this tutorial: https://developer.android.com/resources/tutorials/views/hello-tabwidget.html
I follow all the steps described in the process but I keep getting a runtime exception which I believe has something to do with the fact that nowhere in the tutorial I added the extra activities (songs, artists and albums) related to the content of each tab into the android manifest file.
Am I correct? is this tutorial (like many others) faulty or incomplete?
Since they seem to update these tutorials occasionally, I wouldn't doubt they forgot to mention this part back when this question was asked. They appear to have added a mention to this requirement in the tutorial now (as of 12/20/2010) in step 2:
Duplicate this for each of the three activities, and add the corresponding tags to the Android Manifest file.
Unfortunately, since these are beginner tutorials, they should probably include what the XML tags should look like. Prior to this tutorial, they don't mention how to add activities to the manifest (though you add an activity at the end for hiding the title bar). The markup I used was identical to that on the other question mentioned in the OPs own answer:
<activity android:name=".ArtistsActivity"></activity>
<activity android:name=".AlbumsActivity"></activity>
<activity android:name=".SongsActivity"></activity>
There is a full reference on manifest activities on the Android developer site.
Well thanks for the advice, but I didn't really had to use LogCat. The tutorial is indeed faulty and incomplete, the corrections are very well explained in this related post.
Issues with Android TabHost Example
I'm just amazed by the amount of mistakes in these tutorials, and by the fact that nobody has fixed them yet.
Nelson
I was having the same problem, even after making all the corrections said above and on the following post link
the problem was the AndroidManifest, the following manifest file worked for me.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tabview.android" android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloTabWidget" 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=".AlbumsActivity" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".ArtistsActivity" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".SongsActivity" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
</application>
</manifest>
Related
so, I have a little problem, while opening my app.
I have an "ugly" popup opening for 1-2 sec and then my app goes in.
How exactly can I open my app directly without that 2 sec empty page?
btw - I changed the string of the android:name of my launcher activity to verify that it is this exact activity that is opening empty, and the name changed in the actionbar so it is this activity.
the picture of the first and "ugly" screen
<---
here's my manifest code :
<application
android:name=".BaseApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Holo.Light.NoActionBar" >
<activity
android:name=".UI.activity.HomeActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:launchMode='singleTask'
android:theme="#style/Theme.MyAppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
anyone had this kind of problem before?
thanks a lot.
if anyone ever experience this kind of issue like me,
the solution for me was changing the theme of the app to
android:theme="#android:style/Theme.Holo.Light.NoActionBar"
thank you Kesh for relating that question!
https://cloud.google.com/developers/articles/how-to-build-mobile-app-with-app-engine-backend-tutorial/
Almost halfway down this webpage at heading "Test Client and Backend Communication", at Step 8: when i visit localhost:8888/_ah/admin/
i am not seeing any entity in the dropdown (this is my third try to this tutorial. At first two tries i would only see one entity 'MessageData' out of three.) I should see three entities, esp. CheckIn.
I am stumped. Plus, i am in the learning phase. What must i do in order to create an entity in the datastore?
Thank you in advance.
Here is the code for the MainActivity:
https://github.com/GoogleCloudPlatform/solutions-mobile-shopping-assistant-backend-java/blob/master/MobileAssistant-Tutorial/Phase1_Snippets/MainActivity.01.java
You have first to generate the Cloud EndPoint Library.
Then, you have to check if you have this lign on AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>
The first classe you run when you launch an android app is define here:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<!-- Notre activité SplashScreen -->
<activity android:label="#string/app_name" android:name="com.example.test.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Hope that help you !
I've read up on forum posts about similar errors, but nothing I read works. It looks like my formatting is fine, but I keep getting the indicated error. I've tried refreshing the project and cleaning the project as well as restarting Eclipse entirely.
<manifest
... >
<application
... >
<activity
android:name="com.myNamespace.myPackage.MainActivity"
android:label="#string/app_name">
</activity>
</application>
</manifest>
In your manifest you must have forget to close one of the attribute. Check out your manifest file closely and make sure you have closed all the tags.
I also faced the same isssue but I found that it was coming because of copying and pasting the code in xml file.
Please try to type the code manually and see. Hope the error will not come.
try like this
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myNamespace.myPackage"
android:versionCode="12" android:versionName="2.2.0">
<uses-sdk android:minSdkVersion="3" />
<application android:icon="#drawable/icon" android:label="#string/app_name" android:debuggable="false">
<activity android:name="com.myNamespace.myPackage.MainActivity"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:label="#string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I had the same error until I figured out that the activity tag needs to open and close on the same line. It's not a written syntax but my error was gone when I wrote the whole tag in one line instead of on separate lines. You should try it like this:
<application>
<activity android:name=".MainActivity" android:label="#string/app_name"> </activity>
</application>
</manifest>
I develop in Eclipse on a Mac. When I copy items (both from within Code and/or from a webpage (like Stackoverflow or so) I often get this error. I believe that the copy/paste mechanism is not functioning completely well.
What I do to solve this error, is just typing the complete line (no copy/paste!), all over again.
When I have copied a block I see that the error moves to the next line, which you have to retype also.
Very time consuming and frustrating, but this really works!
I have a basic clock widget here, it works just fine on versions of android below 4.0, you can long press, select widgets and its right there. But when i try to run it on 4.0 or later emulator or real device, it does not show up in widgets section only in Settings>Storage>Apps. I have tried adding a simple activity that just gives users directions on how to install the widget , that suggestion was given as an answer here: Android 4.0: widgets not appearing? . Unless i did it wrong the widget still does not show up in widget drawer.
Here is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.widgetexample1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="14" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".ExampleAppWidgetProvider"
android:label="8-bit cloud widget 1">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="#xml/widget1_info" />
</receiver>
</application>
</manifest>
add below in your manifest.xml.
"android:exported="true".
it might help.
try it.
In your widget metadata xml file check tag <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:xmlns attribute should start with http://.
It looks like you are being hit by a security upgrade which I think happened in HoneyComb.
Basically, in newer versions of Android, you cannot have your widget working, without first launching an Activity.
So add an activity to the project, run it first, and I think your widgets will update.
A good example would be to use a Settings style activity, or perhaps and About box type of thing, to tell the user a bit about your widget. (I use settings in my widgets).
For more info:
Android 4.0: widgets not appearing?
I'm having an issue starting activities in order, and I don't know if it is an issue in the manifest or in the code. I tested this code a while ago when it was working, but now it's not.
The first activity links to the second, which links to the third. I listed the first activity first in the manifest. However, when I start my emulator, it's the second activity that runs first. I am very confused. Here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="hmdywifinal.com"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".Activity1"
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=".Activity2"
android:label="Startpage">
</activity>
<activity android:name=".Activity3"
android:label="Activity3"></activity>
</application>
Do you think something is wrong with it?
Make sure you are running your program from Activity1 and not from Activity2.
If you run it from Activity2 it will skip Activity1 even though you have your manifest set like you described above.
Order in which Manifest file declares Activities has nothing to do with the runtime order.
First Activity gets launched from a Launcher ( which is Activity1 in your case )
I am assuming you are launching Activity2 and 3 using Intents in your code. So you are in control on the way these activities get launched.
Refer to the api Demos, Which has got a similar application Proof Of Concept. It will give you a better idea on mving from one application to other.