Intent filter for date/time settings

by marchinram » Thu, 03 Sep 2009 00:02:20 GMT


Sponsored Links
 Hello,
I need to fire an intent which opens the date/time settings, after
viewing the source for the settings app I saw that the action for the
date/time settings was "android.settings.DATE_SETTINGS", but every
time I fire an intent with that action like so: new Intent
("android.settings.DATE_SETTINGS");, I get an
ActivityNotFoundException, can any help me understand why?
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Bug while selecting from a list of multi-select items whilst using filterable

I'm displaying the contacts in a Multi-select "Ok, Cancel" dialog box. I've
implemented Filterable for the adapter that displays the contacts in the
dialog. The problem is, once i try and select(check) a contact while i'm
using a type ahead, the check box in that particular position is checked and
not the contact.

The initial screen goes like





After type-ahead,






When I hit backspace, the screen appears as,




This is my activity.

                               Cursor c =
getContentResolver().query(People.CONTENT_URI, PROJECTION,

                                 null, null,
Contacts.People.DEFAULT_SORT_ORDER);

                                startManagingCursor(c);

                                ListAdapter adapter1 = new
ContactListAdapter(this, c);

                                LayoutInflater inflater = (LayoutInflater)
this


.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

                                View view = (View)
inflater.inflate(R.layout.list_view, null);

                                 listView = (ListView)
view.findViewById(R.id.contactlist);

                                 listView.setTextFilterEnabled(true);


listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

                                 listView.setAdapter(adapter1);


listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

                                 listView.setOnItemSelectedListener(this);

                                 alertDialog.setView(view);

The adapter goes like,

public class ContactListAdapter extends CursorAdapter implements Filterable
{

public static final String[] PEOPLE_PROJECTION = new String[] { People._ID,

People.NAME, People.NUMBER };

public ContactListAdapter(Context context, Cursor c) {

super(context, c);

mContent = context.getContentResolver();

}

@Override

public View newView(Context context, Cursor cursor, ViewGroup parent) {

final LayoutInflater inflater = LayoutInflater.from(context);

final TextView view = (TextView) inflater.inflate(

android.R.layout.simple_list_item_multiple_choice, parent, false);

view.setText(cursor.getString(1));

return view;

}

@Override

public void bindView(View view, Context context, Cursor cursor) {

((TextView) view).setTag(cursor.getLong(0));

((TextView) view).setText(cursor.getString(1));

}

@Override

public String convertToString(Cursor cursor) {

return cursor.getString(1);

}

@Override

public Cursor runQueryOnBackgroundThread(CharSequence constraint) {

if (getFilterQueryProvider() != null) {

return getFilterQueryProvider().runQuery(constraint);

}

StringBuilder buffer = null;

String[] args = null;

if (constraint != null) {

buffer = new StringBuilder();

buffer.append("UPPER(");

buffer.append(Contacts.ContactMethods.NAME);

buffer.append(") GLOB ?");

args = new String[] { constraint.toString().toUpperCase() + "*" };

}

return mContent.query(Contacts.People.CONTENT_URI, PEOPLE_PROJECTION,

buffer == null ? null : buffer.toString(), args,

Contacts.People.DEFAULT_SORT_ORDER);

}

private ContentResolver mContent;

}





Any help in this is welcome.

Gyan.

--~--~---------~--~----~------------~-------~--~----~

2. Building Android using tcsh

Hello All

i am not able to build Android using tcsh.

My default shell is tcsh and while running the build i change it to
bash as other wise i cannot run the envsetup.sh

after this when i run the lunch and select the option1

i get the following message

build/core/product_config.mk:140: *** No matches for product "".
Stop.

Cheers
Aravind
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. turning off android power management

4. Creating a contact by using an Intent

5. 2d background image on a 3d OpenGL game

6. How to get a region which is not a standard rect area

7. Solved Preferences Reset Problem