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...
 http://developer.android.com/reference/android/widget/EditText.html 

----------------------------------------------------------------------
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
need.

--



Other Threads

1. USSD cose send / receive

Hi there!
I've just started coding for Android. My network provider has a
service via USSD to let you know what's your credit, your various
bonuses and so on, and so I decided to create an activity to get that
data for the user instead of "calling" it.

So far I've found only a little on this, can't find even any
documentation on it. This is the code I've got so far:

package com.elegos.windinforma;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.TextView;

public class WindInforma extends Activity {
    private TextView view;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        String encodedHash = Uri.encode("#");

        this.view = (TextView) findViewById(R.id.main);
        call("*123" + encodedHash); // just an example: credit
    }

    protected void call(String phoneNumber) {
        startActivityForResult(new Intent
("android.intent.action.CALL",
                       Uri.parse("tel:" + phoneNumber)), 1);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
        view.setText("USSD: " + requestCode + " " + resultCode + " " +
data);
    }
}

It ends unexpectedly. Do you know anything it may help me?

I'm developing in Android 1.5
Thanks

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

2. MapView Tutorial help

Hi all,
I've been working religiously through the "Hello Views" tutorials and
all have run ok, except for the MapView tutorial.  I'm stuck on the
first part where you're supposed to run it after adding code for the
zoomControls functionality.

I find that i have two problems that i can't resolve:
1. In the below line from the tutorial code:
linearLayout = (LinearLayout) findViewById(R.id.zoomview);
I get the "Cannot cast from View to LinearLayout" error.

2. The Android 1.5 SDK warns me that the getZoomControls() method is
deprecated.  It would be good if this was updated in the tutorial.
What would be a better way of creating Zoom controls?

I'm running on Eclipse/Vista/Android 1.5

I appreciate any help anyone might have to contribute.

Theo



MY XML FILE LOOKS LIKE:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:id="@+id/mainlayout"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <com.google.android.maps.MapView
        android:id="@+id/mapview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true"
        android:apiKey="02Wl2gFq1mePgIC07Bg7xM2mw_aTEbcoZmTbdcQ"
    />
        <LinearLayout
            android:id="@+id/zoomview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@id/mapview"
            android:layout_centerHorizontal="true"
        />
</RelativeLayout>


MY CLASS FILE LOOKS LIKE:
package com.example.hellolinearlayout;

import android.os.Bundle;
import android.widget.ZoomControls;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class HelloMapView extends MapActivity  {
LinearLayout linearLayout;
MapView mapView;
ZoomControls mZoom;

        @Override
                protected void onCreate(Bundle savedInstanceState) {
                        super.onCreate(savedInstanceState);
                         setContentView(R.layout.map);
                linearLayout = (LinearLayout) findViewById(R.id.zoomview);
                mapView = (MapView) findViewById(R.id.mapview);
                mZoom = (ZoomControls) mapView.getZoomControls();

                linearLayout.addView(mZoom);
        }


        @Override
        protected boolean isRouteDisplayed() {
            return false;
        }

}

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

3. OpenGL on top of camera preview - using two surface views

4. Error trying to execute Monkey app.

5. CFP: droidcon 09 - Business and Development in the Android Ecosystem

6. OpenGL on top of camera preview - using two surface views

7. Can not start Media Player Service