Commit 20303401 authored by Edward Wang's avatar Edward Wang

Allow CompatErrorActivity to show runtime errors

parent 96c56388
......@@ -19,13 +19,23 @@
android:src="@drawable/cone" />
<TextView
android:id="@+id/errormsg"
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/error_not_compatible"
android:textColor="#FF0000"
android:textSize="20dp" />
<TextView
android:id="@+id/errormsg"
android:layout_marginTop="26dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/error_message_is"
android:textColor="#FF0000"
android:textSize="20dp" />
</LinearLayout>
</ScrollView>
\ No newline at end of file
......@@ -94,7 +94,9 @@
<string name="open_mrl_dialog_title">Open network stream</string>
<string name="open_mrl_dialog_msg">Enter network MRL: e.g. http://, mms:// or rtsp://</string>
<string name="media_library">Media library</string>
<string name="error_not_compatible">Sorry, but your device is currently not supported by this version of VLC for Android™.\n\nThe error message is (please mention this when debugging):\n</string>
<string name="error_not_compatible">Sorry, your device is currently not supported by this version of VLC for Android™.</string>
<string name="error_problem">Sorry, VLC for Android had a problem loading and had to close.</string>
<string name="error_message_is">The error message is (please mention this when debugging):\n</string>
<string name="playback_speed">Playback speed</string>
<string name="time_0" translatable="false">0:00</string>
......
......@@ -24,12 +24,28 @@ import android.widget.TextView;
public class CompatErrorActivity extends Activity {
public final static String TAG = "VLC/CompatErrorActivity";
/**
* Simple friendly activity to tell the user something's wrong.
*
* Intent parameters (all optional):
* runtimeError (bool) - Set to true if you want to show a runtime error
* (defaults to a compatibility error)
* message (string) - the more detailed problem
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.not_compatible);
String errorMsg = Util.getErrorMsg();
if(getIntent().getBooleanExtra("runtimeError", false))
if(getIntent().getStringExtra("message") != null) {
errorMsg = getIntent().getStringExtra("message");
TextView tvo = (TextView)findViewById(R.id.message);
tvo.setText(R.string.error_problem);
}
TextView tv = (TextView)findViewById(R.id.errormsg);
tv.setText(getResources().getString(R.string.error_not_compatible) + "\n" + Util.getErrorMsg());
tv.setText(getResources().getString(R.string.error_message_is) + "\n" + errorMsg);
super.onCreate(savedInstanceState);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment