Hi All,

Hopefully you can help me.  I have a TabActivity that creates two tabs
from other activities, one with a webview in it and the other with a
table view in it.  It works fine until I press back to get to the list
view that it was opened from.  When that happens I get the message


12-01 15:56:15.552: WARN/ActivityManager(61): Duplicate finish request
for HistoryRecord{43f9de30 path.to/.WhiteboardActivity}

repeated in the log hundreds of times for 10 seconds before the
message

12-01 15:56:15.561: WARN/ActivityManager(61): Activity destroy timeout
for HistoryRecord{43f9de30 path.to/.WhiteboardActivity}


and the previous activity has hung.  This occurs on both the emulator
and on the 2.2 android device.  Does anyone know why this is
happening, or what I can do to fix it?  I've included the source code
for the 3 classes below. (btw the AbstractActivity contains the
threading for the async loading using the run method and works fine
for many other activities in my app)

Many thanks
Mike

public class WhiteboardActivity extends TabActivity {

        private static final String CONTENT = "Content";
        private static final String DETAILS = "Details";

        private TabHost mtabHost;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.whiteboard);

                mtabHost = getTabHost();

                Intent intent = new Intent(this, 
WhiteboardDetailsActivity.class);
                Intent intent2 = new Intent(this, 
WhiteboardContentActivity.class);

                // add views to tab host
        
mtabHost.addTab(mtabHost.newTabSpec(CONTENT).setIndicator(CONTENT).setContent(intent2));
        
mtabHost.addTab(mtabHost.newTabSpec(DETAILS).setIndicator(DETAILS).setContent(intent));

                // Workaround bug that shows content through tabs
                mtabHost.setCurrentTab(1);
                mtabHost.setCurrentTab(0);

                TextView header = (TextView)findViewById(R.id.wb_title);
                header.setText(WhiteboardsActivity.clickedParent.getTitle());
        }

}

public class WhiteboardContentActivity extends AbstractActivity {

        String content;
        WebView webView;

    @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.whiteboard_content);

                webView = (WebView) findViewById(R.id.wb_content);
                webView.getSettings().setJavaScriptEnabled(false);
    }

        public void run() {

                Whiteboard wb = WhiteboardsActivity.clickedParent;
                try {
                        if (wb != null) {
                                WhiteboardContent wbc = wb.getContent(true);
                                content = wbc.getContents();
                                webView.loadData(content, "text/html", "UTF-8");
                        }
                } catch (IOException e) {

                        networkError(e);
                }
        }
}

public class WhiteboardDetailsActivity extends Activity {

        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.whiteboard_detail);

                Whiteboard w = WhiteboardsActivity.clickedParent;

                TextView header = (TextView)findViewById(R.id.wb_title1);
                header.setText(w.getTitle());
                header = (TextView)findViewById(R.id.wb_description);
                header.setText(w.getDescription());
                header = (TextView)findViewById(R.id.wb_workspace);
                header.setText(w.getParentWorkspace().getTitle());
                header = (TextView)findViewById(R.id.wb_created);
                header.setText(w.getCreatedDate());
                header = (TextView)findViewById(R.id.wb_added_by);
                header.setText(w.getAuthor().getDisplayName());
        }
}

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

Reply via email to