Make Text View Editable upon longclick

by Srinivas VG » Tue, 05 Apr 2011 03:46:42 GMT

Sponsored Links

I am new to android development. I was implementing a feature in
android where in upon long click of the Textview,it *should be
editable.upon long click of the contents set by textView,  I tried
in the listener method , I used the following:


But I was unable to perform the function...plz let me know if there
are any other approaches...



Re: Make Text View Editable upon longclick

by TreKing » Wed, 06 Apr 2011 01:06:55 GMT

 On Sat, Apr 2, 2011 at 11:00 PM, Srinivas VG

Swap the TextView out with an EditText.

TreKing <> ; - Chicago
transit tracking app for Android-powered devices


Sponsored Links

Other Threads

1. Application crash when instantiating ViewGroup in GridView

If I return a View of type Layout from BaseAdapter::getView I'm
immediately greeting with the error "The application XXX has stopped
unexpectedly ... "  However, if I return an ImageView or TextView the
error is averted.  Does anyone know if this is a limitation of

public class GridAdapter extends BaseAdapter {
        public GridAdapter() {

        public View getView(int position, View convertView, ViewGroup
parent) {

            if (convertView == null) {
                convertView = new LinearLayout(ParentActivity.this);

            return convertView;


2. NIO Buffer position problem?


I'm currently trying to port a Java JRE6 program into Google Android
platform. This program uses NIO buffers to read data from a binary
file. It needs to read byte and short from the file.

With standard JRE6, I could "navigate" throught the memory mapped data
using thoses kind of code :

final FileInputStream fis = ....
final FileChannel channel = fis.getChannel();
byteBuffer =, 0, channel.size());

// Read some bytes.

OK, this seems to work well too on Google Android. But problems start
to happen when I need to read short values after reading byte values
from the buffer.

When, in JRE6 platform, I do :

// Read a short value

I successfully retrieve the first short value at the corresponding
position from byteBuffer. Eg, if byteBuffer is at position 10, then it
reads two bytes (pos 11 and 12) and computes then as a short. That's
the standard functionnality.

But with Google Android, it doesn't seem to work that way. The same
code doesn't produce the same output :

// Read a short value

The "byteBuffer.asShortBuffer()" successfully returns a ShortBuffer,
but position seems to be lost in the creation of the ShortBuffer. Eg,
if position in byteBuffer was 10, the position of ShortBuffer is
actually 0. So when I read a short value from this ShortBuffer, it
actually read the two first bytes of the stream (0 and 1) instead of
reading bytes at position 11 and 12 as the normal JRE6 does.

Thus, each time I want to read a short value, either I must use the
ByteBuffer and computes by myself two bytes into one short, either I
use the "asShortBuffer" method but then I have to compute myself the
right position into the new buffer, thing I didn't have to make with

Is that a bug or a normal thing with Android ?
Thanks for your help,


3. Hello android_beginers

4. how import org.apache.commons.httpclient ?

5. Stored data files in Android App

6. Installed my APK on my G1 via my website, but app does not appear??

7. Installed my APK on my G1 via my website, but app does not appear??