Commits

M Haidar Hanif committed eca39d5

Support Android API level 4 or later by condition

Add android.support.v4.app package into repo library
Path: ./libs/android-support-v4.jar

  • Participants
  • Parent commits a45ec6d

Comments (0)

Files changed (2)

File AndroidManifest.xml

         android:allowBackup="true"
         android:icon="@drawable/ic_launcher"
         android:label="@string/name_app"
-        android:theme="@style/AppTheme">
+        android:theme="@style/AppTheme" >
 
         <activity
             android:name=".MainActivity"
             android:label="@string/name_app"
-            android:launchMode="singleTask">
+            android:launchMode="singleTask" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
         </activity>
 
         <activity
+            android:name=".DisplayNumberActivity"
+            android:label="@string/title_number"
+            android:parentActivityName="com.mhaidarhanif.android.kargu.MainActivity" >
+            <meta-data
+                android:name="android.support.PARENT_ACTIVITY"
+                android:value="com.mhaidarhanif.android.kargu.MainActivity" />
+        </activity>
+
+        <activity
             android:name=".AboutDialogActivity"
             android:label="@string/title_about"
-            android:theme="@android:style/Theme.Dialog">
+            android:theme="@android:style/Theme.Dialog" >
         </activity>
 
     </application>

File src/com/mhaidarhanif/android/kargu/DisplayNumberActivity.java

 
 import android.annotation.SuppressLint;
 import android.annotation.TargetApi;
+import android.content.Intent;
 import android.os.Build;
 import android.os.Bundle;
 import android.support.v4.app.NavUtils;
 import android.view.MenuItem;
+import android.widget.TextView;
 
 public class DisplayNumberActivity extends MainActivity {
 
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_display_number);
 
+    // Get number from intent
+    Intent intent = getIntent();
+    String number = intent.getStringExtra(MainActivity.EXTRA_NUMBER);
+
+    // Create text view
+    TextView textView = new TextView(this);
+    textView.setTextSize(40);
+    textView.setText(number);
+
+    // Set text view as activity layout
+    setContentView(textView);
+
     /** Check minimum API level number to use ActionBar API */
     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
       // Show Up button in ActionBar