tags:

views:

18

answers:

1

Hi,

In my tablet whenever i select the checkbox option for cell phone tethering iam observing below line in my Eclipse logcat

07-09 07:28:18.279: INFO/ActivityManager(940): Starting activity: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.tether.Tether }

I want to use this one in my application.Is it possible to use this component or can i see inbuilt application methods in my Application like API methods after including that component?Please give me sample code on this

A: 

You can start any intent from your app, which is Android's strength.

Off the top of my head:

ComponentName component = new ComponentName("com.android.settings", "com.android.settings/.tether.Tether");
Intent intent = new Intent(component);
intent.setAction(Intent.ACTION_MAIN);
startActivity(intent);

I may be a bit off with the component name (you may need to do some trial and error on the strings), but that should basically be it.

EboMike
Hi,In Log i found that component is not found error.But whenever I manually do settings it appear on Log.Why this happends?
Rajendar
What's the exact log output? You may need to play with the names, like try removing the stuff before the "/", etc.
EboMike