Welcome to my blog which contains anything and everything I feel is worthwhile sharing......

Tuesday, August 11, 2015

Providing the correct class and package name in an intent

When  creating intents it should be remembered that the full qualified path to the activity class referred by the intent has to be given. This is case sensitive. Luckily when the intent is created inside an activity class, the IDE would indicate if we misspell anything.


This is all fine but a rude shock awaits if we have an intent inside xml - a layout etc.
Have a look at this case where there's an intent inside a  preference screen.


the package name is misspelled - actually it's typed Totaldemo where it should be totaldemo.
We won't get any indication until we fire up the emulator or launch the app on the device and actually tap to navigate to the desired activity.


To prevent any typos the full qualified path can be obtained like this :


this will copy the following to the clipboard 
com.apps.totaldemo
but if we select the class itself and copy the qualified name as shown below


this is copied :
/TotalDemo/src/com/apps/totaldemo/Sayit.java

Dusting off the old blog, dusting off eclipse

It's been quite a while since I've been last here. Around the same time as my last post I started to dabble with android development - I actually made a bunch of apps for my personal use. Most of those projects stagnated due to lack of time. Recently I decided to continue/improve those projects and to post some quick tips and code snippets that would be useful and share-worthy on this blog.
All my work is on eclipse - I haven't made the leap to Android Studio yet and most of the code snippets/screen grabs are back from a couple of years, and even the new ones are on Eclipse...but what the heck I'll be posting them anyway.