Closed GoogleCodeExporter closed 8 years ago
I have found that is is crashing when trying to get preferences from the .db
file.
At line Opening db.
I have tried to add a get external state request and then open a dialog box but
then
i just get a error that onCreate has not happened yet and it still force
closes.
I will continue to work on it and see what i come up with.
Original comment by Zipste...@gmail.com
on 20 May 2010 at 1:47
I went ahead and got something to work for the updater force close on start up
if the
sd card is not available.
In MainActivity after onCreate:
if
(android.os.Environment.getExternalStorageState().equals(android.os.Environment.
MEDIA_MOUNTED))
{
Log.d(TAG,"SDcard Available");
}
else
{
Log.d(TAG,"SDcard Not Available");
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.toast_layout,
(ViewGroup) findViewById(R.id.toast_layout_root));
ImageView image = (ImageView) layout.findViewById(R.id.image);
image.setImageResource(R.drawable.stop);
TextView text = (TextView) layout.findViewById(R.id.text);
text.setText(R.string.sdcard_not_avail);
Toast toast = new Toast(getApplicationContext());
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.setDuration(Toast.LENGTH_LONG);
toast.setView(layout);
toast.show();
finish();
}
and the xml file names toast_layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toast_layout_root"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="8dp"
android:background="@color/trans_grey"
>
<ImageView android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dp"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textSize="18.0sp"
android:textColor="@color/white"
/>
</LinearLayout>
Of course it point to a new .png i added and also new colors in colors.xml
Hope that helps you,
James
Original comment by Zipste...@gmail.com
on 25 May 2010 at 12:34
thanks. will have a look on this for the next version
Original comment by FireFart
on 26 May 2010 at 4:59
thx. ive implemented a check
Original comment by FireFart
on 30 May 2010 at 3:36
Original issue reported on code.google.com by
Zipste...@gmail.com
on 17 May 2010 at 3:14