Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 918103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:19:01+00:00 2026-05-15T18:19:01+00:00

PROBLEM SOLVED!! I just found my mistakes, after looking through the debugger over and

  • 0

PROBLEM SOLVED!!

I just found my mistakes, after looking through the debugger over and over again, but anyway, thanks everyone!!

Hi there, I am very new to Android and was working through some tutorials. Now I got stuck at the Tab tutorial. The code seems to be fine at first glance as I am not getting any errors, but when I try to run the app on the emulator it always crashes and I get an “application stopped unexpectedly” error message.

I already tried what was said in the discussion about the tab layout problem, but the changes I made didn’t help with the error. If someone can help me with that, that would absolutely great. If you would like to see the code, just tell me if I should post or send it.

Thank u in advance.

This is my code for the Manifest.xml file because I am not sure, if I have done something wrong there:

   <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.mobilevideoeditor.moved"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
           <activity android:name=".GalleryView" android:label="@string/app_name"
                  android:theme="@android:style/Theme.NoTitleBar">   
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <activity android:name=".ShareGalleryView" android:label="@string/app_name"
                      android:theme="@android:style/Theme.NoTitleBar"> </activity> 
                      <activity android:name=".EditGalleryView" android:label="@string/app_name"
                  android:theme="@android:style/Theme.NoTitleBar"> </activity>  
        </activity>
    </application>
</manifest> 

This is the GalleryView.java file:

package com.mobilevideoeditor.moved;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class GalleryView extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Resources res = getResources(); // Resource object to get Drawables
        TabHost tabHost = getTabHost();  // The activity TabHost
        TabHost.TabSpec spec;  // Reusable TabSpec for each tab
        Intent intent;  // Reusable Intent for each tab

        // Create an Intent to launch an Activity for the tab (to be reused)
        intent = new Intent().setClass(this, EditGalleryView.class);

        // Initialize a TabSpec for each tab and add it to the TabHost
        spec = tabHost.newTabSpec("edit").setIndicator("Edit",
                          res.getDrawable(R.drawable.ic_tab_edit))
                      .setContent(intent);
        tabHost.addTab(spec);

        // Do the same for the other tabs
        intent = new Intent().setClass(this, ShareGalleryView.class);
        spec = tabHost.newTabSpec("share").setIndicator("Share",
                          res.getDrawable(R.drawable.ic_tab_share))
                          .setContent(intent);
        tabHost.addTab(spec);

        tabHost.setCurrentTab(0);
    }
}

Here is the code for the main.xml:

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="5dp">
    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />
    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="5dp" />
</LinearLayout>

The code for the EditGalleryView.java and the ShareGalleryView.java:

package com.mobilevideoeditor.moved;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;


public class ShareGalleryView extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        TextView textview = new TextView(this);
        textview.setText("This is the Share tab!");
        setContentView(textview);
    }
}

And finally the code for the ic_tab_share.xml and the ic_tab_edit.xml:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- When selected, use ic_tab_share (grey icon) -->
    <item android:drawable="@drawable/ic_tab_share"
          android:state_selected="true" />
    <!-- When not selected, use ic_tab_share_unselected (white icon)-->
    <item android:drawable="@drawable/ic_tab_share_unselected" />
</selector>

Thanks again 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:19:02+00:00Added an answer on May 15, 2026 at 6:19 pm

    I had a similar problem when I first tried the Tab Layout Tutorial from official developer’s site.

    Since you are getting the ‘force close’ error on running the application it would be most probably due to not adding the activities in AndroidManifest.xml file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is not really a question because I just solved the problem, but I
I just solved a problem I was having putting the Set keyword in a
I just solved the first problem from Project Euler in JavaFX for the fun
I have solved this problem, I just need to know what to do. I
I solved my problem by using CGColorGetComponents , but I would like to understand
I search for a lot forums but nothing found, my problem is that I
I know there were a couple similar questions, but none solved my problem. This
it seems that I just solved my problem why I couldn't use the ASP.NET
I've hit this problem a few times, and I've always just found a work
I'm trying to solve this problem, its not a homework question, its just code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.