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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:58:29+00:00 2026-06-09T21:58:29+00:00

I want my application start automatically when the device is placed in the car

  • 0

I want my application start automatically when the device is placed in the car doc. I find this useful code for manifest but I want to give user option with checkbox if he want to use this option.

 <action android:name="android.intent.action.MAIN" /> 
<category android:name="android.intent.category.LAUNCHER" /> 
<category android:name="android.intent.category.CAR_DOCK" />
 <category android:name="android.intent.category.DEFAULT" />

How to make this possible if user check option then app will be started when it is placed in the car dock, otherway not.

  • 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-09T21:58:30+00:00Added an answer on June 9, 2026 at 9:58 pm

    Use the above manifest entries for a broadcast reciever and not for a activity. And inside broadcast receiver you can check the preference and then launch the activity.

    Edit:
    Register the DockReciever with above manifest changes. If that does not work then use below action

    <action android:name="android.intent.action.ACTION_DOCK_EVENT"/>
    

    you will have to check the state of the dock if you use this.

    public class DockReciever extends BroadcastReceiver {
    
        @Override
        public void onReceive(Context arg0, Intent arg1) {
            SharedPreferences settings = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
            boolean launch = settings.getBoolean(Utility.KEY_LAUNCH, false);
            if(settings.getBoolean(Utility.KEY_LAUNCH, false)){
             Intent intent = //your Activity intent goes here
             arg0.startActivity(intent);
             }
    
         }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails application and I want to start the server automatically whenever
I want to start my application automatically when the phone boots. I declared a
I want to put some images in an area at the application start. As
I've declared an object which gets instantiated on application start. I want to access
I want to start manage application ( Settings -> Application -> manage application ->
I want to start an application which will use ajax push, however the web
i want to start an application on receiving sms from a particular number. i
I want to create a simple j2me application for a start which links with
I'm about to start developing a Business application where I want the frontend to
I want to load My ACL plugin to the application, and just start working

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.