android-image

Photo picker. Portrait turns to landscape

 ̄綄美尐妖づ 提交于 2019-12-24 00:22:49
问题 How to pick an image from gallery (SD Card) for my app? I have implemented the second answer (With the downsampling). When I select an image in portrait, the image will be shown in landscape mode.. Does anybody know why this is? And how to fix this? Thanks in advance! P.s. Sorry I've made a new topic out of this but the poster protected his topic against newbies like me :) 回答1: You have to get the exif rotation of the pic, like this and arrange youur bitmap accordingly public static int

Image not loading through android webview

 ̄綄美尐妖づ 提交于 2019-12-23 20:13:06
问题 I have a webview that loads a webpage and sometimes in this webpage there are pictures. However, i have encountered 2 instances where the image does not load and they each give different outcome. Outcome #1 : Webpage is loaded but image is not loaded (Format used : .jpeg) Outcome #2 : Webpage is loaded but image is not loaded. However, at where the image should be, there is a icon with a question mark. (Format used : .jpg) I have other webpages that have images of the same format and from the

Image reloaded when scroll listView in android

笑着哭i 提交于 2019-12-23 16:24:01
问题 I am trying write a news list application. I had parsed JSON data from Server and created CustomListAdapter. There are three textView and imageView in my listView. It works great, image loaded and I set it to imageView. When scroll list view images are reloaded from server. This is my Fragment: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.news_fragment, container, false); this

How to check if android.hardware.Camera is released?

萝らか妹 提交于 2019-12-23 10:56:06
问题 I got an exception while releasing camera object "java.lang.RuntimeException: Method called after release" following is my code and exception stack trace. if (camera != null) { camera.stopPreview(); camera.release(); camera = null; } Exception stack trace - java.lang.RuntimeException: Method called after release() Thread[main,5,main] android.hardware.Camera._stopPreview(Native Method) android.hardware.Camera.stopPreview(Camera.java:626) com.s5.selfiemonkey1.activity.Preview.surfaceDestroyed

Unbinding drawables onPause() causing unresponsive back navigation and skipping this step cause memory overflow

ぃ、小莉子 提交于 2019-12-23 09:26:54
问题 I am using an image to set as the background for all my activities but it was causing a memory overflow issue and crash the app. Now I am unbinding my drawables on pause() and on Destroy() in my activity and now it shows blank screen on pressing back button. So how can I avoid this without using extra memory. protected void onPause(){ super.onPause(); unbindDrawables(findViewById(R.id.login_root)); } protected void onDestroy() { unbindDrawables(findViewById(R.id.login_root)); super.onDestroy(

Timestamp of generated bitmap - Android

眉间皱痕 提交于 2019-12-22 10:15:59
问题 I have an app where I have downloaded an image file from the web and I save this file in external storage. Later, to add this image to the media store, I call: MediaStore.Images.Media.insertImage(getContentResolver(), fullPath, "IMG_"+System.currentTimeMillis(),null); However, my picture always adds to the end of the gallery - it thinks that the picture was taken in 1970. How do I change this information? Thanks! 回答1: Worked using JPEGS (not PNG!) with ExifInterface 来源: https://stackoverflow

Uploading High res images in android

不羁的心 提交于 2019-12-22 09:24:03
问题 Hi I wanted to upload high res images to my php server.Right now i am sending images to my server using encoded string.Problem here is i can not upload high res image it leads me to Out of memory. My image is around 1-2 Mb large in size. Here is a snippet how i upload image to server. String encodedPagerpath=""; if(!FILE_PAGER_PATH.equals("") && FILE_PAGER_PATH.length()!=0) { byte [] b=imageTobyteArray(FILE_PAGER_PATH,150,150); if(b!=null) { encodedPagerpath=Base64.encodeToString(b, Base64

Custom ListView with many images gets Out Of Memory Exception

孤者浪人 提交于 2019-12-22 08:55:01
问题 I'm trying to create an Android ListView that will look like Instagram pictures feed or Facebook's. I'm getting Out Of Memory Exception on my Galaxy Nexus after loading some images (only a few). I scaled them, but still, the number of images isn't fixed and theoretically can be unlimited. On Facebook and Instagram they load lots of images and other data and it works well. What do you think? Can i achieve those performances with native Android coding? If i'll create a HTML5 feed (like Facebook

Custom ListView with many images gets Out Of Memory Exception

与世无争的帅哥 提交于 2019-12-22 08:54:15
问题 I'm trying to create an Android ListView that will look like Instagram pictures feed or Facebook's. I'm getting Out Of Memory Exception on my Galaxy Nexus after loading some images (only a few). I scaled them, but still, the number of images isn't fixed and theoretically can be unlimited. On Facebook and Instagram they load lots of images and other data and it works well. What do you think? Can i achieve those performances with native Android coding? If i'll create a HTML5 feed (like Facebook

Can Eclipse automatically generate different DPI images for Android projects?

落爺英雄遲暮 提交于 2019-12-22 08:51:47
问题 I'm trying to import a 600x600 PNG I made into my Android project so that I can use it as a full-sized image in an Activity. Dragging and dropping it onto my /res folder just puts it in that folder, which of course generates an "invalid resource directory name" error. I can drop it into any of the /res/drawable folders and that works fine, except then it's only in that one folder. Surely, there's an inbuilt tool which can take my image and scale it appropriately for each /res/drawable folder.