Would this not be the prefered action.
http://developer.android.com/reference/android/app/UiModeManager.html#ACTION_ENTER_CAR_MODE

<http://developer.android.com/reference/android/app/UiModeManager.html#ACTION_ENTER_CAR_MODE>
Thanks

Zach

On Mon, Oct 11, 2010 at 12:23 AM, KANTESH BABANNAVAR
<[email protected]>wrote:

> I think actoin should be android.intent.category.CAR_DOCK.
>
> On Oct 11, 7:57 am, zachariahyoung <[email protected]> wrote:
> > I'm trying to write a program to send an email when the phone is
> > placed in the car dock.  I have create a Android Project with no
> > Activities.
> >
> > Below is the one class I have created.  It just has a Toast so I can
> > see that it is working.  Below is the code which I think is correct.
> >
> > package com.demo.carmode;
> >
> > import android.content.BroadcastReceiver;
> > import android.content.Context;
> > import android.content.Intent;
> > import android.util.Log;
> > import android.widget.Toast;
> >
> > public class CarMode extends BroadcastReceiver {
> >
> >         @Override
> >         public void onReceive(Context arg0, Intent intent) {
> >                 Toast.makeText(arg0, "Hello Car Mode",
> Toast.LENGTH_SHORT).show();
> >                 Log.d("ExmampleBroadcastReceiver", "intent=" + intent);
> >                 Log.i("CarMod", "hello world");
> >         }
> >
> > }
> >
> > My mainfest is real simple also.
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <manifest xmlns:android="http://schemas.android.com/apk/res/android";
> >         package="com.demo.carmode" android:versionCode="1"
> > android:versionName="1.0">
> >         <application android:icon="@drawable/icon"
> android:label="@string/
> > app_name">
> >                 <receiver android:name=".CarMode" android:enabled="true">
> >                         <intent-filter>
> >                                 <action
> android:name="android.intent.action.MAIN"></action>
> >                                 <category
> android:name="android.intent.category.CAR_DOCK"></
> > category>
> >                         </intent-filter>
> >                 </receiver>
> >         </application>
> > </manifest>
> >
> > I'm testing the code by click on the phone Car Home app.  Would this
> > not be the same thing as docking the phone?
> >
> > Have I not setup my manifest correctly?  Could I be missing something
> > else.  Seems like this should work.  I also see the active and
> > category appear on my logcat.
> >
> > Thanks for the help
> >
> > Zach
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Zachariah Young
http://zachariahyoung.com
[email protected]
(479) 966-9169

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to