android-imageview

save multiple image views as a single file

江枫思渺然 提交于 2019-12-25 04:45:12
问题 In my application , one Relative Layout has totally three ImageView() 's . I want to save all the three imageviews as a single .png file to the device storage on a single button click. My code: Layout XML : <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/make" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="300dp"

Load large bitmap from url and resize it

我只是一个虾纸丫 提交于 2019-12-25 04:16:31
问题 I want load huge image from url and show on my device. I read this post for doing this. In that example they use native drawable but I want get image from server. I am using this code private void getBitmap(ImageView imageView,final String url){ mBitmapOptions = new BitmapFactory.Options(); mBitmapOptions.inJustDecodeBounds = true; URL mUrl = null; InputStream is= null; try { mUrl = new URL(url); is = mUrl.openStream(); } catch (MalformedURLException e) { e.printStackTrace(); } catch

Android throwing out of memory error when trying to load 1 megabyte image

Deadly 提交于 2019-12-25 03:57:49
问题 The relevant code: runOnUiThread(new Runnable() { @Override public void run() { ImageButton btn = (ImageButton) findViewById(R.id.info_image); btn.setImageResource(currentID[currentIDPos]); } }); It's saying that the run method is making a 400-some megabyte allocation. My jpgs are no more than a megabyte in size. The run() method is called on a timer every 3-4 seconds or so and on click, but that shouldn't matter because from what I can tell using printlns the run() is only called once before

Displaying an image in ListView from SQLite database

眉间皱痕 提交于 2019-12-25 03:39:11
问题 I'm a little stuck at the moment. I know similar questions have been asked, but I haven't been able to find anything that has helped. I'm trying to get and image to appear in ListView from an internal database inside my android application. I have a database with 141 rows, and each row is labeled 1,2 or 3. I need a different png image (saved in my res/drawable folder) to show depending on the 1,2, or 3. Here is my current Query. Any advice would be welcome. I realize there may be a better way

How to set the size and position of an image?

余生长醉 提交于 2019-12-25 03:37:11
问题 I am trying to set the size and position of an image (image2) on the screen so that it is in the same position and size relative to the background image (image1) it is on no matter the screen size. To do this, I try to alter the layout parameters of image2 in my onCreate method of my Activity class: public class Game_main extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow

How to load picture from @drawable to ImageView using fragments?

半城伤御伤魂 提交于 2019-12-25 02:42:45
问题 How to load picture from @drawable to ImageView using fragments? In every single fragment I have other picture. With array of String that's works, but with pictures doesn't. It's only returns 0. XML Array (PS. also doesn't work) <?xml version="1.0" encoding="utf-8"?> <resources> <array name="images"> <item>@drawable/one</item> <item>@drawable/two</item> </array> </resources > XML View: <ImageView android:id="@+id/imageView1" android:layout_width="fill_parent" android:layout_height="0dp"

Easy way to make an ImageView that is underneath a GridView match the GridView's size exactly?

橙三吉。 提交于 2019-12-25 01:55:58
问题 My ImageView is displaying an image of a chess style board for a little game I'm making. It is covered by a GridView that displays the images of my pieces. I have it displaying underneath but it is not positioned properly. I want it to match exactly the edges of the GridView but don't know how. Is there some way to make the GridView a "parent" of the ImageView so then I could say "match_parent" in the XML for it's height and width and so on? Here is a screen of how my app looks now. I want

Showing a full-width ImageView containing a SVG distorts it

本秂侑毒 提交于 2019-12-25 00:53:15
问题 My aim is to show a SVG background image filling the whole screen's width, in a ConstraintLayout . A Button is superposed to this background image, that's why you can see in the mock-up below: The background image is the one that contains the stars. Its start and end sides would be constrained to the root GroupView , so that it would fill entirely the width of the screen. The problem is the following: whether I bind the bottom side to the bottom side of the screen or not, the background image

I used sharePrereference to save the string in textView, afyer turn off app and open again, it doesnt work

旧巷老猫 提交于 2019-12-25 00:29:45
问题 As title, i want to get the new string after i edit the textView, after i edit it and turn on the app again, The textview were still empty, Could some one help me what did i miss in my code, Thank you in advance for any assistance that can be provided here. Here is my code below: public class MainActivity extends ActionBarActivity { //private SharedPreferences saveUserName; private AutoCompleteTextView editText1, editText2, editText3, editText4, editText5, editText6; private ImageButton

How to create Image slide show within a custom InfoWindow on Google Maps V2 - Android API

爷,独闯天下 提交于 2019-12-25 00:21:12
问题 I am a newbie wrt android development. My goal is to have a video running inside a customized info window in google maps V2 API android. I know how to make a video run inside a view (by loading series of images making them to look like a movie) Also I learnt how to load image inside a customized infowindow. I am trying to have image slide show inside the infowindow. But the problem is only the first image is getting loaded. Unless otherwise I click on the marker again, the infoWindow contents