Fix to get Astrid working back on Android 1.5

pull/14/head
Tim Su 15 years ago
parent 144d64a323
commit 57a9283d7a

@ -22,8 +22,8 @@ import android.net.NetworkInfo.State;
import android.text.InputType;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import android.view.View.OnTouchListener;
import android.widget.TextView;
import com.todoroo.andlib.service.Autowired;
@ -276,4 +276,11 @@ public class AndroidUtilities {
}
return null;
}
/**
* @return Android SDK version as an integer. Works on all versions
*/
public static int getSdkVersion() {
return Integer.parseInt(android.os.Build.VERSION.SDK);
}
}

@ -8,6 +8,7 @@ import android.net.Uri;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.astrid.utility.Preferences;
@SuppressWarnings("nls")
@ -37,7 +38,7 @@ public class Calendars {
* @param table provider table, something like calendars, events
*/
public static Uri getCalendarContentUri(String table) {
if(android.os.Build.VERSION.SDK_INT >= 8)
if(AndroidUtilities.getSdkVersion() >= 8)
return Uri.parse("content://com.android.calendar/" + table);
else
return Uri.parse("content://calendar/" + table);
@ -45,7 +46,7 @@ public class Calendars {
/** Return calendar package name */
public static String getCalendarPackage() {
if(android.os.Build.VERSION.SDK_INT >= 8)
if(AndroidUtilities.getSdkVersion() >= 8)
return "com.google.android.calendar";
else
return "com.android.calendar";

Loading…
Cancel
Save