First, please give your post a useful, relevant title. This will help
people decide if it's a topic worth reading and makes the discussion easier
to find later if someone searches for something similar.

On Fri, Jun 29, 2012 at 2:32 PM, Jaison Brooks <[email protected]>wrote:

> public class MainActivity extends Activity {
>
>     public void  LaunchComponent (String packageName, String name){
>     Intent task = new
>             Intent(Intent.ACTION_MAIN);
>     PackageManager manager =
>             getPackageManager ();
>     task = manager.getLaunchIntentForPackage("com.xxx.xxx.xxx");
>     task.addCategory(Intent.CATEGORY_HOME);
>     startActivity(task);
>
>     }
> }
>

You've defined a method, "LaunchComponent" ... and that's it. How do you
expect it to get called?

i do NOT have a layout file, i didnt think i would need one, since i am not
> creating a UI at all.
>

Correct.


> Any recommendations would help alot, i've tried a few links, and i just
> cannot get something to compile right.
>

Override onCreate(), which is called when your app is launched, and call
your method from there.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to