Android 19 - No resource found [Fixes #97]
This commit is contained in:
parent
7a473e7dd6
commit
917df3d6c3
@ -78,7 +78,6 @@
|
||||
<activity
|
||||
android:name="de.appplant.cordova.plugin.printer.ui.SelectPrinterActivity"
|
||||
android:label="Printer"
|
||||
android:theme="@android:style/Theme.Material.Settings"
|
||||
android:exported="false">
|
||||
</activity>
|
||||
</config-file>
|
||||
|
@ -137,6 +137,10 @@ public abstract class Meta {
|
||||
int resId;
|
||||
resId = res.getIdentifier(name, type, pkgName);
|
||||
|
||||
if (resId == 0) {
|
||||
resId = Resources.getSystem().getIdentifier(name, type, "android");
|
||||
}
|
||||
|
||||
return resId;
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.print.PrinterId;
|
||||
import android.print.PrinterInfo;
|
||||
@ -85,6 +86,11 @@ public final class SelectPrinterActivity extends Activity {
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
setTheme(Meta.getResId(
|
||||
this, "style", "Theme.Material.Settings"));
|
||||
}
|
||||
|
||||
setContentView(Meta.getResId(
|
||||
this, "layout", "select_printer_activity"));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user