Answer the question
In order to leave comments, you need to log in
Incorrect styles of AlertDialog on API 18?
Subject. activity code:
package com.gobonus.gobonus;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class InternetDisabled extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_internet_disabled);
AlertDialog.Builder builder =
new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
builder.setTitle(R.string.title);
builder.setMessage(R.string.err_503);
builder.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
builder.show();
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gobonus.gobonus">
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/welcomeActivivty">
<activity android:name=".WelcomeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".LoginActivity"
android:label="@string/title_activity_login"
android:theme="@style/GB"
android:parentActivityName=".WelcomeActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.gobonus.gobonus.WelcomeActivity" />
</activity>
<activity android:name=".InternetDisabled"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity
android:name=".CabinetActivity"
android:label="@string/title_activity_cabinet"
android:theme="@style/GB_Green.NoActionBar" />
<activity
android:name=".CabinetActivityy"
android:label="@string/title_activity_cabinet_activityy"
android:theme="@style/GB_Green.NoActionBar"></activity>
</application>
</manifest>
<!--alert dialog-->
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">#FFCC00</item>
<item name="android:textColorPrimary">#FFFFFF</item>
<item name="android:background">#5fa3d0</item>
</style>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.gobonus.gobonus.InternetDisabled">
</RelativeLayout>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question