Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8205437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:14:22+00:00 2026-06-07T08:14:22+00:00

Okay, so, I’ll preface this by stating I’m using Titanium, so that’ll, I assume,

  • 0

Okay, so, I’ll preface this by stating I’m using Titanium, so that’ll, I assume, put a bad taste in your mouth. So, I’m sorry for my lack on knowledge on the Android side of things.

So, I’ve got a thing set up to receive GCM notifications. I can send them correctly to my app, and the code runs and tries to launch my app when it’s clicked. However, it’s just giving me this in the logcat:

I/ActivityManager(  307): START {act=com.geneca.journaling.mobile.GenecaJournalingActivity cat=[android.intent.category.LAUNCHER] flg=0x34000000 bnds=[0,102][720,230] u=0} from pid -1
W/InputMethodManagerService(  307): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@427a60a8 attribute=null

I got the C2DM receiving stuff from a third party, and I’ve tried to modify it to do what I need, but I’m clearly doing something not quite right.

Here’s the onMessage:

@Override
protected void onMessage(Context context, Intent intent) {
    Log.d(LCAT, "Message received");

    HashMap data = new HashMap();
    for (String key : intent.getExtras().keySet()) {
        Log.d(LCAT, "Message key: " + key + " value: "
                + intent.getExtras().getString(key));

        String eventKey = key.startsWith("data.") ? key.substring(5) : key;
        data.put(eventKey, intent.getExtras().getString(key));
    }
    if (C2dmModule.getInstance() == null) {
        int icon = 0x7f020000; // get this from R.java
        CharSequence tickerText = "Geneca Journaling";
        long when = System.currentTimeMillis();

        Bundle extras = intent.getExtras();
        CharSequence contentTitle = "Rate your journal";
        CharSequence contentText = "Notification Content";
        String title = extras.getString("title");
        String message = extras.getString("message");
        if(title != null) {
            contentTitle = title;
        }
        if (message != null) {
            contentText = message;
        }

        //Intent notificationIntent = new Intent(this, C2DMReceiver.class);

        Intent launcherintent = new Intent("com.geneca.journaling.mobile.GenecaJournalingActivity");
        launcherintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.     FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        launcherintent
                .setComponent(ComponentName
                        .unflattenFromString("com.geneca.journaling.mobile.GenecaJournalingActivity"));
        launcherintent.addCategory("android.intent.category.LAUNCHER");


        PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
                launcherintent, 0);

        // the next two lines initialize the Notification, using the
        // configurations above

        Notification notification = new Notification(icon, tickerText, when);

        notification.defaults = Notification.DEFAULT_ALL;
        notification.flags = Notification.FLAG_AUTO_CANCEL;
        notification.setLatestEventInfo(context, contentTitle, contentText,
                contentIntent);
        String ns = Context.NOTIFICATION_SERVICE;
        NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
        mNotificationManager.notify(1, notification);
    } else
        C2dmModule.getInstance().sendMessage(data);
}

Here’s my manifest stuff (I think)

<android xmlns:android="http://schemas.android.com/apk/res/android">
    <manifest>
        <activity android:name=".GenecaJournalingActivity"/>
        <permission
            android:name="com.geneca.journaling.mobile.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
        <uses-permission android:name="com.geneca.journaling.mobile.permission.C2D_MESSAGE"/>
        <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
        <uses-permission android:name="android.permission.WAKE_LOCK"/>
        <application>
            <service android:name="com.findlaw.c2dm.C2DMReceiver"/>
            <receiver
                android:name="com.google.android.c2dm.C2DMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED"/>
                    <category android:name="android.intent.category.HOME"/>
                </intent-filter>
                <intent-filter>
                    <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
                    <category android:name="com.geneca.journaling.mobile"/>
                </intent-filter>
                <intent-filter>
                    <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
                    <category android:name="com.geneca.journaling.mobile"/>
                </intent-filter>
            </receiver>
        </application>
    </manifest>
</android>

There’s also another manifest section in a different place, because of how Titanium handles things:

<android:manifest>
    <permission android:name="com.geneca.journaling.mobile.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="com.geneca.journaling.mobile.permission.C2D_MESSAGE" />

    <!-- This app has permission to register and receive message -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <!-- Send the registration id to the server -->
    <uses-permission android:name="android.permission.INTERNET" />

    <!-- App must have this permission to use the library -->
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <activity android:name="com.geneca.journaling.mobile.GenecaJournalingActivity"/>

    <application>
           <!-- In order to use the c2dm library, an
               application must declare a class with the name C2DMReceiver, in its 
               own package, extending com.google.android.c2dm.C2DMBaseReceiver

               It must also include this section in the manifest, replacing 
                "com.google.android.apps.chrometophone" with its package name. 
           -->
        <service android:name="com.findlaw.c2dm.C2DMReceiver" />

        <!-- Only google service can send data messages for the app. If permission is not set -
             any other app can generate it --> 
        <receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">

            <!-- Start receiver on boot -->
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
                <category android:name="android.intent.category.HOME"/>
            </intent-filter>

            <!-- Receive the actual message -->
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <category android:name="com.geneca.journaling.mobile" />
            </intent-filter>
            <!-- Receive the registration id -->
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="com.geneca.journaling.mobile" />
            </intent-filter>
        </receiver>

    </application>
</android:manifest>

If the app is already open, it runs some Titanium code, which I think I’ll be able to figure out, but if the app is not open, it hits stuff in the onMessage which I can’t quite figure out.

Any help would be appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:14:23+00:00Added an answer on June 7, 2026 at 8:14 am

    This line:

    Intent launcherintent = new Intent("com.geneca.journaling.mobile.GenecaJournalingActivity");
    

    Creates a new Intent with the action com.geneca.journaling.mobile.GenecaJournalingActivity.

    Is this what you wanted?

    Intent intent = new Intent(Intent.ACTION_MAIN);
     intent.setComponent(new ComponentName("com.package.address","com.package.address.MainActivity"));
      startActivity(intent);
    

    or

     Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
    startActivity(LaunchIntent);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay so I can't figure this out. Like a file that I using grep
Okay, so I'm trying to make a game that uses this algorithm: http://www.codeproject.com/Articles/15573/2D-Polygon-Collision-Detection But
Okay say your using a app, and you opened a new activity and then
Okay let me do a better job explaining this. Assume I have a person
Okay, so I know that using eval() isn't great, but I haven't been able
Okay, next PHPExcel question. I have an HTML form that users fill out and
Okay this question is very simple: I have a facebook page, and a website.
Okay, I feel a bit foolish for having to ask this but I guess
okay, i'm setting up a multi-user chat system. i have a messages table, that
Okay, this is probably a very basic question; but, I'm just getting back in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.