Click here to Skip to main content
15,888,113 members
Home / Discussions / Android
   

Android

 
SuggestionRe: Help Pin
David Crow26-Apr-17 3:36
David Crow26-Apr-17 3:36 
GeneralRe: Help Pin
Member 1302311826-Apr-17 3:38
Member 1302311826-Apr-17 3:38 
GeneralRe: Help Pin
Richard MacCutchan26-Apr-17 21:07
mveRichard MacCutchan26-Apr-17 21:07 
Questionhow can i open a rar file with password Pin
Member 1298133419-Apr-17 3:05
Member 1298133419-Apr-17 3:05 
AnswerRe: how can i open a rar file with password Pin
Nick_314159265419-Apr-17 4:08
Nick_314159265419-Apr-17 4:08 
AnswerRe: how can i open a rar file with password Pin
CHill6019-Apr-17 4:10
mveCHill6019-Apr-17 4:10 
SuggestionRe: how can i open a rar file with password Pin
David Crow24-Apr-17 9:55
David Crow24-Apr-17 9:55 
QuestionTrying to set Imageview with background operations Pin
Gizem Alpaydin18-Apr-17 6:09
Gizem Alpaydin18-Apr-17 6:09 
I am working with googlemap. I have implemented custom marker window, this window contains photo of the marker. I am taking the url of the photo as string and setting it into imageview with thread. However, the code is not syncronized with user. When I have clicked the marker, it shows the photo of the previeus marker that I have clicked. When I did debug, I can see that true url values are coming from background but the setting image into imageview operation is becoming late. How can I solve this problem? I have tried picasso and glide but still same problem.

@Override
    public void onMapReady(GoogleMap map) {

        this.infoWindow = (ViewGroup)getActivity().getLayoutInflater().inflate(R.layout.info_marker_window, null);
        this.mekanfoto = (ImageView) infowindow.findViewById(R.id.mekan_foto);
        googleMap = map;
   
        if(googleMap!=null){

            googleMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
                @Override
                public View getInfoWindow(Marker marker) {
                    return null;
                }

                @Override
                public View getInfoContents(final Marker marker) {
                    if(mLastLocation.getLatitude()!=marker.getPosition().latitude||
                            mLastLocation.getLongitude()!=marker.getPosition().longitude){

                        customMarker = CustomMarker.getCustomMarker(listCustomMarker, marker);
                        final String URL = customMarker.getVenue().getFoto(); 
                        createThread(mekanfoto,URL).start();
                        mapWrapperLayout.setMarkerWithInfoWindow(marker, infoWindow);
                        return infoWindow;
                    }
                    return null;}
            });
        }
    }


private synchronized Thread createThread(final ImageView imageView, final String URL)
    {
        final Bitmap[] b = new Bitmap[1];
       Thread thread=new Thread(new Runnable() {
           @Override
           public void run() {
               b[0] =download_Image(URL,imageView);

           }
       });
        return thread;
    }

public Bitmap download_Image(String url,ImageView imageview) {
        //---------------------------------------------------
        URL newurl = null;

        try {
            newurl = new URL(url);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }

        Bitmap mIcon_val = null;

        try {
            URLConnection urlConnection=newurl.openConnection();
            InputStream is=urlConnection.getInputStream();
            mIcon_val= BitmapFactory.decodeStream(is);
        } catch (Exception e) {
            e.printStackTrace();
        }finally {

        }
        imageview.setImageBitmap(mIcon_val);
        return mIcon_val;

        //---------------------------------------------------
}


modified 18-Apr-17 12:31pm.

QuestionI don't find the mistake I make Pin
User 1106097926-Mar-17 4:15
User 1106097926-Mar-17 4:15 
AnswerRe: I don't find the mistake I make Pin
Richard MacCutchan26-Mar-17 7:00
mveRichard MacCutchan26-Mar-17 7:00 
GeneralRe: I don't find the mistake I make Pin
User 1106097926-Mar-17 7:38
User 1106097926-Mar-17 7:38 
GeneralRe: I don't find the mistake I make Pin
Richard MacCutchan26-Mar-17 7:40
mveRichard MacCutchan26-Mar-17 7:40 
GeneralRe: I don't find the mistake I make Pin
User 1106097926-Mar-17 7:44
User 1106097926-Mar-17 7:44 
GeneralRe: I don't find the mistake I make Pin
David Crow26-Mar-17 10:38
David Crow26-Mar-17 10:38 
GeneralRe: I don't find the mistake I make Pin
User 1106097927-Mar-17 3:07
User 1106097927-Mar-17 3:07 
QuestionRe: I don't find the mistake I make Pin
David Crow27-Mar-17 12:32
David Crow27-Mar-17 12:32 
GeneralRe: I don't find the mistake I make Pin
Richard MacCutchan27-Mar-17 21:44
mveRichard MacCutchan27-Mar-17 21:44 
SuggestionRe: I don't find the mistake I make Pin
David Crow26-Mar-17 10:36
David Crow26-Mar-17 10:36 
QuestionRe: I don't find the mistake I make Pin
David Crow26-Mar-17 10:34
David Crow26-Mar-17 10:34 
GeneralRe: I don't find the mistake I make Pin
User 1106097927-Mar-17 3:36
User 1106097927-Mar-17 3:36 
SuggestionRe: I don't find the mistake I make Pin
David Crow27-Mar-17 12:34
David Crow27-Mar-17 12:34 
GeneralRe: I don't find the mistake I make Pin
User 1106097927-Mar-17 21:43
User 1106097927-Mar-17 21:43 
QuestionAndroid project Pin
Member 1307301022-Mar-17 18:16
Member 1307301022-Mar-17 18:16 
GeneralRe: Android project Pin
Richard MacCutchan22-Mar-17 23:05
mveRichard MacCutchan22-Mar-17 23:05 
Questionon android E-health care project Pin
Member 1307301820-Mar-17 21:01
Member 1307301820-Mar-17 21:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.