I copy and paste image on EditText, but EditText show me 'obj'

Adding an image on EditText works fine. However, copying an image is another problem.

When I insert an image on EditText by using ImageSpan it shows correctly, but I copy inserted image, EditText shows me only 'obj'.

Is there somebody who know how to solve this problem?

Asked by: Miranda173 | Posted: 20-01-2022

Answer 1

According to the documentation for the ClipboardManager currently you can only retrieve text from the clipboard so I don't think it will be possible for you to paste an image.

You can hook into the paste into the EditText using the onTextContextMenuItem() method so it may be possible to create the ImageSpan manually but I don't think there will be an image in the Clipboard to paste.

Answered by: Lily824 | Posted: 21-02-2022

Answer 2

I think android 2.4 will merge 3.0's ClipboardManager ability to copy any intent data. http://gametest2.ruixinonline.com/docs/reference/android/content/ClipboardManager.html

Answered by: Ryan630 | Posted: 21-02-2022

Similar questions

Android: EditText and Button; when click Button, unfocus EditText and hide soft keyboard?

<EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:id="@+id/name" android:singleLine="true" android:maxLength="12" android:capitalize="none" android:inputType="text" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/search_button" android:text="Search" /> ...

android - dialog window with edittext closes when edittext is clicked

I have a window that opens in a Dialog theme, which is how I want it to look. it's to update the title of a note (example)... so there is a text box and 2 buttons. problem is as soon as I click on the edittext for the keyboard to show up the dialog window closes !!!! this is the declaration I have in the mainfest for the dialog activity (note: I tried with the windowSoftInputMode value and without)

android - Is there anyway to make an EditText start typing at the top left corner of the EditText?

I have an EditText with the property: android:minLines="3" However, when I start typing, it types in the middle of the EditText. Is there any way to get this to start typing at the top left of the EditText area?

android - Change focus of edittext when tap outsite edittext

I have a edit text to input url, and a webview to display the website My problem is: when i go google.com, i tap to my edit text so my edit text has focus. I tap to search area in gooogle, but my edittext doen't lose focus. How can can i change focus of edittext when tap outsite edittext?

how do i enter the value in one EditText and get answer in other EditText android

I have two EditText fields,whenever i enter the value in one editText,the other should display the answer for one calculation that taking the value of first editText,Iam unsure how to do this,thanks in advance(android)

android - I want to add the values of editText boxes over several layouts to post them to an editText box on a layout called results

Here is my formula: (R.id.dch135-(R.id.drg59*.0752)-(R.id.drg6*.061)-(R.id.drg11*.0412)-(R.id.dplenum*.0802)-(R.id.s2way*4.5)-(R.id.s3way*6.9)-(R.id.sbal35*4.5)-(R.id.sunbal70*8.8)-(R.id.s4way*8.8)-(R.id.s8way*13)-(R.id.sdc6th*3.3)-(R.id.sdc9th*2.7)-(R.id.sdc12th*2)-(R.id.sdc6tp*6)-(R.id.sdc9tp*9)-(R.id.sdc12tp*12)-(R.id.samp*14.5) I have editText boxes on several layouts. I want to run th...

Android EditText like Google Search EditText

Is there somewhere the code of Google Search in Android? The xml-layout would be enough for me. Or maybe there is a possibility to add a button to the right of the EditText just like adding an icon in the corner? Thanks.

Android: why i am not able to change the value of EditText with respect to another EditText?

I am going to change the text of the edittext based on the value enter on the another edittext. and also like same thig with visa-versa. For that i have use the TextChanged Listener and implemented as like below: includedText.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if(!(includ...

android - Edittext jumps to next edittext, but wrong

I need help with my app. This is my xml file with Relative layout, and I need to jump to the next edittext after pressing Enter key. But there is a problem, if I'm writing to the editTextKm and press Enter key, it jumps to the editTextFullTank, but I need to jump to the editTextManufactYear. How to do it? <EditText android:id="@+id/editTextSPZ" android:layout_width="fill_parent" ...

java - Show EditText B when EditText A has letters

All- I am trying to hide EditText B,C until EditText A has at least one character in it. I have tried using a textwatcher... EditText editText = (EditText) findViewById(R.id.p1); //A final EditText editText$ = (EditText) findViewById(R.id.p1$); //B final TextView $ = (TextView) findViewById(R.id.$); //C editText$.setVisibility(View.INVISIBLE); $.setVisibility(View.INVISIBLE); editText...

how to Remove text onfocus of EditText in android?

I have a scenario, for example, a EditText in acitivity instead of using Textview as a label of it i want to put text "UserName" inside EditText and if user clicks on it. it should disappear and EditText should get empty to enter data in it. How can I achieve this?

android - onclick EditText Stretch problem!

i am facing issue that when i click on edittext its width gets changed i want to fix its width according to screen so that it covers whole screen and then button at right side of it. here is the code

android - Wraping EditText Boxes in Layout

I have a UI that has 6 EditText boxes. 3 of those EditText boxes don't show up when in vertical orientation. I was hoping that wrap_content would wrap the non-showing 3 to the next line but found out that LinearLayout only allows for one row. When in horizontal orientation I get all 6 of them showing. I tried a TableView with two rows of 3 each. That looks dorky when in horizontal orientation. Do...

android - Getting EditText field from XML

I have an activity in my app, when i call the line EditText username = (EditText)findViewById(R.id.usernameText); the app crashes, why is this?

android - How to set an EditText on top of a ListView?

I am trying to do an autocomplete version my way (logic, layout, etc...) , so I don't want to use the AutoCompleteTextView. My question is how to set an EditText on top of a ListView in a class inheriting from a ListAcvitivy. I tried two kinds of layout, none of them worked. First one : <EditText android:id="@+id/autocomplete_server" android:layout_width="fill_paren...

android - IME window overlap cursor in Edittext, how to prevent it?

I'm using Edittext and it has images and texts. Then, I add image file on Edittext and I click Edittext, IME window shows, naturally. ( * At that time cursor is located at right-bottom corner of added image file.) The problem is IME window overlap cursor, so users complain that 'where is my cursor?' How to prevent that IME window overlap cursor?

java - EditText selects by default?

Whenever I have an EditText field in my android application, it is highlighted with the blinking cursor for input as soon as the activity is started (though the keyboard doesn't pop up). How can I disable this?

Android : EditText with custom keyboard

I created my own custom keyboard following the the example in the sdk. Now I would like to use this custom keyboard by default on my EditText in my app (actualy I have to long press the edittext and then choose my custom keyboard). How can I do that ? (seems to be related to the inputType property but I can't find out how to set it) Thanks !

layout - Problem with sizes of EditText and Button in Android

I want to make the edittext width the same size as button. My EditText is currently very small. I use relative layout. <TextView android:id="@+id/aha4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="17dip" android:text="Vzdevek:" android:layout_below="@id/aha3" /> <EditText android:id="@+id/nick" android...

Why is my Android app force closing when I try to check if an EditText has a double

Scanner scanner = new Scanner(lapsPerMile_st); if (!scanner.hasNextDouble()) { Context context = getApplicationContext(); String msg = "Please Enter Digits and Decmials Only"; int duration = Toast.LENGTH_LONG; Toast.makeText(context, msg, duration).show(); lapsPerMileEditText.setText(""); ...

Still can't find your answer? Check out these communities...

Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android