0

I trying to extends my main class from TabActivity ... I wrote the code as bellow :

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

public class AndroidTabAndListView extends TabActivity {

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

but I have a worning that the type TabActivity is deprecated !!!!!

enter image description here

Have any one any Idea about this ???

thank you in advance , Fadel

BinaryMan
  • 269
  • 2
  • 6
  • 18

1 Answers1

2

Please see the official document.

This class was deprecated in API level 13. New applications should use Fragments instead of this class; to continue to run on older devices, you can use the v4 support library which provides a version of the Fragment API that is compatible down to DONUT.

See also:

"The type TabActivity is deprecated" For app tab

https://stackoverflow.com/questions/12600207/the-type-tabactivity-is-deprecated-help-to-use-in-older-device

Android: TabActivity deprecated, use Fragments?

Or if you have a more specific question, you can add more info.

Community
  • 1
  • 1
pt2121
  • 11,720
  • 8
  • 52
  • 69
  • Dear @EntryLevelDev ... firstly thank u so much , secondly : Im working in V2 and I runed my application and it worked succufuly ... will it produce problem in the future ???? – BinaryMan Oct 18 '13 at 19:54
  • Something has been tagged as deprecated programmers are encouraged not to use it. There is no longer a guarantee that it will exist in a future version. – pt2121 Oct 18 '13 at 19:56
  • 1
    @Fadel It probably works fine. But if you're gonna make a real production app. It's better to use fragment as the doc suggests. – pt2121 Oct 18 '13 at 19:58