Hi all,

i'm trying to do the following:
1. Fetching an external resource through a seperate thread;
2. When loaded this thread sends a message to the specified handler
3. This handler executes a method which sets a view to visible

All goes well, but now i want to include an extra time, so that when the
external resource is not loaded after 5 seconds, the view is going to be
displayed anyway. But here's the catch, my handler function goes well, but
when i excute the same method outside the handler, it sets the View.visible
just fine, but the view just isn;t displaying.

the code reads something like:


        Timer timer = new Timer();
        Calendar date = Calendar.getInstance();
        date.add(Calendar.SECOND, 1);
        timer.schedule(new TimerTask() {
            public void run() {
                displayArticleList();
            }},
            date.getTime()
        );

        // fetch the feed in a seperate thread
        final Handler feedHandler = new Handler(){
            @SuppressWarnings("unchecked")
            public void handleMessage(Message message) {
                 displayArticleList();
            }
        };

.......

    protected void displayArticleList(){
        Log.d("Here", "displayArticleList method: " +
ll_splash.getVisibility() + " == " + View.GONE);
        if(!(ll_splash.getVisibility()==View.GONE)){
            ll_splash.setVisibility(View.GONE);
            LinearLayout alc = (LinearLayout)
findViewById(R.id.article_list_container);
            alc.setVisibility(View.VISIBLE);
        }
    }


-- 
Regards,


Patrick Plaatje

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to