Member Avatar

How can I minify my code in here, I am giving each 23 total imageview a eventhandler. code works, but I like to make the code shorter. I tried to use for loops to shorten the code. here is a example what I tried to do: for (int i = 0 ; i < imgArrayList.size() ; i++) { imgArrayList.get(i).setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { selectedTile = i; } }); } but it can't because, the "i" inside the handle method is final. I can't pass the "i" inside the handle method. my goal is, that a specific …

Member Avatar
+1 forum 4
Member Avatar

As what was stated on the header I want to implement either a "paint" or "eraser" function whichever feature more convenient for user to edit paint/censor unwanted parts of a photo displayed on a imageview before uploading it to a server in the edited format and a redo function if user makes a mistake while editing? How do I come about doing it, I've read relevant topics on Canvas, or FingerPaint but still puzzled on how to implement it based on the scenario in this link [here](https://drive.google.com/file/d/0B2rvGRbu0A83LU1pQjRicnNFS0U/view)? Thanks for any help rendered! idImage = (ImageView)findViewById(R.id.idImage); Bitmap bitmap = null; bitmap …

Member Avatar
+0 forum 1
Member Avatar

Hello I'm new to android development. So I've tried this coding where when I clicked on the imageview it will change to another image. And it's working perfectly. But I have 10 imageview. And every time each of the image being click it will change to another image. Is there any simpler code to be use on 10 imageview? How can I do it? Thanks :) package com.example.subtraction; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; public class Level_1 extends Activity { private ImageView imageOne=null; private ImageView imageTwo=null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_level_1); imageOne = …

+0 forum 0
Member Avatar

Hi All, My problem is: i'm trying to convert byte[] into image. The byte[] comes from JSON and it's in this format: `"4oCwUE5HDQoaCgAAAA1JSERSAAAAfwAAAFAIBgAAADBHwqrDsAAAAAlwSFlzAAAAJwAAACcBKgnigJhPAAAgAElEQVR4xZPCrMK9ecWSZcOZfcOfw7c5w5vCvW/CqXp..."` it goes for another 100 lines. The code where the problem occurs: DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(PlayersListActivity.URL); httpPost.setEntity(new UrlEncodedFormEntity(parameters, "UTF-8")); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); BufferedHttpEntity bufferedEntity = new BufferedHttpEntity(httpEntity); // if this is null the web service returned an empty page if(httpEntity == null) // response is empty so exit out return null; String jsonString = EntityUtils.toString(bufferedEntity); // again some simple validation around the returned string if(jsonString != …

+0 forum 0
Member Avatar

I have an image view in my android application. I want to set the picture dynamically from a link. Example: The user has an id number of 0920305 The image from http://teachers.usls.edu.ph/student_pics/0920305 will appear on the image view.

Member Avatar
+0 forum 2

The End.