kavitha R
kavitha R

Reputation: 5

2.3.3 app not working in higher versions

i made a small app that displays some text and move in between pages i made it with 2.3.3 sdk 10 version but now when i install in 4.4.1 phones its having compatibility issues saying Incompatible version

package com.top20e1;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;

public class TopActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.main);
  //  requestWindowFeature(Window.FEATURE_NO_TITLE);
    final Button switchact =(Button)findViewById(R.id.button1);
    switchact.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Intent act2 = new       
     Intent(view.getContext(),secondactivity.class);
            startActivity(act2);

        }
    });


    }}

This is a typical layout in my app

    <?xml version="1.0" encoding="utf-8"?>
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >



<LinearLayout
    android:id="@+id/linearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/wood" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#171616"
        android:text="management color"
        android:textAppearance="?android:attr/textAppearanceLarge" />



    <RelativeLayout
        android:id="@+id/relativeLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

          <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Previous" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:text="Next" />

    </RelativeLayout>

</LinearLayout>


</ScrollView>

And this is my manifest

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="preferExternal"
package="com.top20e1"
android:versionCode="1"
android:versionName="1.0" 
>

<uses-sdk android:minSdkVersion="10" />

<application
    android:icon="@drawable/bg"
    >
    <activity
        android:label="@string/app_name"
        android:name=".Top20" >
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
     <activity
     android:name="secondactivity"
     android:label="@string/app_name">
      </activity>
      <activity 
          android:name="thirdactivity"
         ></activity>
      <activity 
          android:name="fourthactivity"
         ></activity>
      <activity 
          android:name="fiveactivity"
         ></activity>
      <activity 
          android:name="sixactivity"
         ></activity>
      <activity 
          android:name="sevenactivity"
         ></activity>
       <activity 
          android:name="eightactivity"
         ></activity>
        <activity 
          android:name="nineactivity"

         ></activity>
         <activity 
          android:name="tenactivity"
         ></activity>
          <activity 
          android:name="elevenactivity"
         ></activity>
           <activity 
          android:name="twevelactivity"
         ></activity>
            <activity 
          android:name="thirteenactivity"
         ></activity> <activity 
          android:name="fourteenactivity"
         ></activity>
          <activity 
          android:name="fifteenactivity"
         ></activity>
           <activity 
          android:name="sixteenactivity"
         ></activity>
      <activity 
          android:name="seventeenactivity"
         ></activity>
       <activity 
          android:name="eighteenactivity"
         ></activity> <activity 
          android:name="nineteenactivity"
         ></activity>
          <activity 
          android:name="twentyactivity"           ></activity>

</application>

</manifest>

Upvotes: 0

Views: 147

Answers (1)

Jethro Monzada
Jethro Monzada

Reputation: 104

This should work, just add this on your Android Manifest File.

 <uses-sdk android:maxSdkVersion="19" />

4.4.1 is I think for KitKat so if you want your app to be compatible to the latest version which is so far Lollipop then just make the maxSdkVersion to 22.

Upvotes: 1

Related Questions