finish transition to custom activity as dialog instead of using AlertDialog which is no longer working in Android P, closes #377
This commit is contained in:
@@ -18,5 +18,8 @@
|
||||
android:name="android.accessibilityservice"
|
||||
android:resource="@xml/accserviceconfig" />
|
||||
</service-->
|
||||
<activity android:excludeFromRecents="true"
|
||||
android:theme="@android:style/Theme.Dialog"
|
||||
android:name=".Kp2aDialog"></activity>
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
@@ -23,6 +23,9 @@ public class Kp2aDialog extends Activity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
|
||||
|
||||
setContentView(R.layout.activity_kp2a_dialog);
|
||||
ListView listview = ((ListView)findViewById(R.id.mylist));
|
||||
final String clientPackageName = getIntent().getStringExtra("clientPackageName");
|
||||
@@ -83,7 +86,7 @@ public class Kp2aDialog extends Activity {
|
||||
itemNames[i++] = sft.displayName;
|
||||
|
||||
listview.setAdapter(new ArrayAdapter<String>(this,
|
||||
android.R.layout.simple_list_item_1,
|
||||
R.layout.kp2a_textview,
|
||||
itemNames));
|
||||
listview.setClickable(true);
|
||||
listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@@ -114,8 +117,10 @@ public class Kp2aDialog extends Activity {
|
||||
|
||||
StringForTyping theItem = items.get(item);
|
||||
|
||||
Kp2aDialog.this.finish();
|
||||
KP2AKeyboard.CurrentlyRunningService.commitStringForTyping(theItem);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@android:id/text1"
|
||||
android:paddingTop="6dip"
|
||||
android:paddingBottom="6dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="20sp" />
|
||||
Reference in New Issue
Block a user