manage curosr in edit text...

by chitacan » Wed, 21 Apr 2010 14:31:24 GMT

Sponsored Links
 hi all

im developing small text editor for android device.

in this app, i need to manage cursor in edit text view.

is there any method to get(or set... ) current cursor's position in
edit text???


manage curosr in edit text...

by Justin Anderson » Wed, 21 Apr 2010 15:54:25 GMT

 Not sure,  but you could look at the docs as well as I could to find out... 

There are only 10 types of people in the world...
Those who know binary and those who don't.


Sponsored Links

manage curosr in edit text...

by chitacan » Wed, 21 Apr 2010 16:44:21 GMT

 Thanx for your reply

i found 'selection' class, i think this class can implement what i


Other Threads

1. Android Contacts database doubt

Problem Statement - Display contacts who are in one of the groups
selected by the user in preference screen. ( As it is there in the
native android contacts preference screen )

I use the following query to query the contacts

 String select = "((" + Contacts.DISPLAY_NAME + " NOTNULL) AND ("
                + Contacts.HAS_PHONE_NUMBER + "=1) AND ("
                + Contacts.DISPLAY_NAME + " != '' ))AND ("
                + Contacts.IN_VISIBLE_GROUP + "=1)";
        Cursor contact_cursor =
getContentResolver().query(Contacts.CONTENT_URI, null, select,
                                null, Contacts._ID + " COLLATE LOCALIZED ASC");

this query gives me only the following columns

columnnumber 23=send_to_voicemail
columnnumber 22=photo_id
columnnumber 21=contact_status_ts
columnnumber 20=contact_status_res_package
columnnumber 19=display_name_source
columnnumber 18=contact_presence
columnnumber 17=display_name_alt
columnnumber 16=sort_key
columnnumber 15=starred
columnnumber 14=_id
columnnumber 13=in_visible_group
columnnumber 12=sort_key_alt
columnnumber 11=display_name
columnnumber 10=last_time_contacted
columnnumber 9=contact_status_icon
columnnumber 8=lookup
columnnumber 7=contact_status_label
columnnumber 6=phonetic_name_style
columnnumber 5=phonetic_name
columnnumber 4=has_phone_number
columnnumber 3 =custom_ringtone
columnnumber 2=contact_status
columnnumber 1=times_contacted

To get the group information what i do at present is to query each
contact id from (the above query) for the groups with the URI

Uri groups = ContactsContract.Data.CONTENT_URI;
        String selected_groups = " (1, 2 , 3, 4 ,
        String selection = Data.MIMETYPE+ "='"
+GroupMembership.CONTENT_ITEM_TYPE+"' AND "
+GroupMembership.GROUP_ROW_ID +" IN "+ selected_groups ;

String[] Projection = new String[]
Cursor group_cursor = getContentResolver().query(groups, Projection,

I dont think it is best to query for each contact id if it is a member
of a group or not. My problem is not about getting the group
information but getting them quickly so the the contact list gets
displayed with users filter instantly


2. startActivityForResult weirdness

I'm writing an app and would like to redirect the user from the main
activity to enter a passcode. I've been able to run the passcode
activity from my settings/preferences activity no problem:
onActivityResult() gets called and everything works fine. From the
main activity (the one set as MAIN in AndroidManifest.xml), though, it
won't call onActivityResult(). I logged everything very closely and
the passcode activity is doing the same thing in both cases
(setResult() followed by finish()).

I noticed the RedirectEnter activity in the API demos, which is the
one set as MAIN, does not actually do the redirect either, the
redirect is in RedirectMain which is called only when you push the Go

Is there some rule that says the MAIN activity cannot redirect?
Currently I'm formulating how to reorganize my app such that the
program doesn't ask for a passcode on the main screen, but that's
really not the most elegant solution.

I could post code but I've tried so many variations that I'm not sure
which one is best to post. I've tried delaying the call to the
passcode activity to later in the startup sequence (various points
from onCreate() through onAttachedToWindow()) to no avail.
onActivityResult() doesn't get called.




3. How to create a dpi 320 simulator

4. Detecting device orientation change using android:screenOrientation

5. Setting the Java build path in imported project

6. How does Morelocale 2 works?

7. WTR(Ratjoen) The Great Arc