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 8723793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:42:10+00:00 2026-06-13T07:42:10+00:00

I am developing an app using phonegap and mobile jquery. There’s a point in

  • 0

I am developing an app using phonegap and mobile jquery.

There’s a point in my app where it is running in the background and if an event triggered from js, I want to make my app to come in foreground.

How can I make my app come to foreground from background. I have a single activity with following attribute:

android:configChanges="orientation|keyboardHidden|screenLayout"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustPan" 
        android:launchMode="singleTask"        
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar"

what i tried to make my app in foreground is :

    Intent intent = new Intent(mContext , MainActivity.class);
    intent.setAction(Intent.ACTION_MAIN);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);
    mContext.startActivity(intent);

And

mContext.startActivity(((Activity)mContext).getIntent());

(MainActivity is the only activity in my app ) but it is not working. I am using android 4.0.

Update : In android 2.3 its working fine but its not working in android 4.0

  • 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-13T07:42:11+00:00Added an answer on June 13, 2026 at 7:42 am

    After a effort I got a solution…
    I implemented a broadcast listener. when i receive any event, i send a broadcast and in broadcast receiver i launch the app.

    Intent intent = new Intent(mContext, NotificationBroadcastReceiver.class);
            mContext.sendBroadcast(intent);
    

    ** Receiver** :

    public final class NotificationBroadcastReceiver  extends BroadcastReceiver {
          @Override
          public void onReceive(Context context, Intent intent) {
             System.out.println("Broadcast recieved");
             context.startActivity(new Intent(context,A.class).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
          }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a mobile app using PhoneGap and jQuery Mobile. From what I've read
I am developing an app using phonegap for Android. I want this mobile application
I'm developing a PhoneGap app for Android using Jquery and Jquery Mobile. I've got
I'm developing an app using jquery mobile, phonegap and openDatabase. When the app is
I am developing a jQuery Mobile and PhoneGap app. I am using this code:
I am developing an app for iOS using Phonegap bundled with jQuery Mobile 1.1.1.
I am developing a mobile app using HTML5 + PhoneGap (there's not ANY backend
I am developing an app using jQuery1.6.1, Phonegap 1.5(cordova-1.5.0.js), jQuery Mobile 1.0.1, and the
I am developing an iphone app on phonegap and I am using jQuery mobile.
i am developing an android phonegap app using phonegap 1.3 and jquery mobile 1.0

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.