1. Download our Official Android App: Forums for Android!

Apps Get Activity name from an application

Discussion in 'Android Development' started by eatsleeplaxsoccer3, Feb 28, 2012.

  1. eatsleeplaxsoccer3

    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    19
    Joined:
    Dec 24, 2009

    Dec 24, 2009
    19
    1
    16
    Hi
    I am trying to launch Google Voice when I double tap home.
    I need to get the activity name to launch Google Voice. How can I get this?
    To launch it, I need the full application name, which I have, com.google.android.apps.googlevoice but I also need the activity to start it up.
    I have tried several guesses, but nothing has worked so far.
    I just want it to start and open the main inbox ui
    thanks
     

    Advertisement

  2. jonbonazza

    jonbonazza Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    1,930
    Joined:
    Jul 13, 2010

    Jul 13, 2010
    1,930
    457
    163
    Male
    Im on my phone, so I cant really get into it right now, but google the concept of "reflection in Java."
     
  3. eatsleeplaxsoccer3

    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    19
    Joined:
    Dec 24, 2009

    Dec 24, 2009
    19
    1
    16
    i don't have an android developer kit set up on my machine, i just posted in the dev forum thinking one of y'all might know an easy way.
    I'm looking at the classes.dex file but it's not that easy.
    tried a java decompiler but didn't read .dex files
     
  4. Stigy

    Stigy Some say...
    Rank:
    None
    Points:
    413
    Posts:
    4,100
    Joined:
    Nov 5, 2009

    Nov 5, 2009
    4,100
    3,023
    413
    Male
  5. Stigy

    Stigy Some say...
    Rank:
    None
    Points:
    413
    Posts:
    4,100
    Joined:
    Nov 5, 2009

    Nov 5, 2009
    4,100
    3,023
    413
    Male
    Delete plz - double post.
     
  6. eatsleeplaxsoccer3

    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    19
    Joined:
    Dec 24, 2009

    Dec 24, 2009
    19
    1
    16
    thanks,
    it looks like if i could run this code on an adroid phone with google voice installed, i could find the string I'm looking for
    PackageManager pm = context.getPackageManager();
    Intent appStartIntent = pm.getLaunchIntentForPackage("com.google.android.apps.googlevoice");
    if (null != appStartIntent)
    {
    //get activity name from appStartIntent
    }
    however I don't have the capability of doing this


    I've been going through the decompiled apk of google voice and trying to just find a startup activity.
    the closest I've come is
    com.google.android.apps.googlevoice/com.google.android.apps.googlevoice.activity.conversationlist.ConversationListActivity which launched it but only gave me a blank UI.
     
  7. eatsleeplaxsoccer3

    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    19
    Joined:
    Dec 24, 2009

    Dec 24, 2009
    19
    1
    16
    I got it!
    So others know
    for Google Voice, the startup activity is
    com.google.android.apps.googlevoice.SplashActivity
    so if you want google voice to open when you double tap home, modify the double tap entry in SQLLite to com.google.android.apps.googlevoice/com.google.android.apps.googlevoice.SplashActivity
    if you need to find the startup activity for something in general, open up the androidmanifest.xml (open the .apk with winzip or something, you don't need a full decompiler)
    and look for an activity with the category main or launcher
    <activity android:theme="@style/TranslucentThemeNoActionBar" android:label="@string/app_icon_name" android:name=".SplashActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
     

Share This Page

Loading...