0

Androidでは、クリーンマスター がゲームブースター やMyJioアプリのすべてのアプリケーションを1つのフォルダーに入れるように、プログラムでホーム画面にフォルダーを作成したいと考えています。Live フォルダーを試してみましたが、非推奨であり、最新の Android バージョンでも機能しません。それはウィジェットですか、それともこれについて私が理解できないことですか、これを理解するのを手伝ってください。前もって感謝します

4

2 に答える 2

1

ダイアログでそれを行うことができます。複数のアプリ画像でアプリアイコンを作成し、それをアプリアイコンとして設定します.1つのアクティビティを作成し、マニフェストに登録します

    <activity android:name=".DialogActivity"
        android:theme="@android:style/Theme.DeviceDefault.Dialog">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

今あなたの活動は次のとおりです

public class DialogActivity extends Activity {

AlertDialog dialog;
LinearLayout mLinearLayout;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.test);

    mLinearLayout = (LinearLayout) findViewById(R.id.test);
    mLinearLayout.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });

    Window window = this.getWindow();
    window.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));


    AlertDialog.Builder builder = new AlertDialog.Builder(this);

    builder.setPositiveButton("ok", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            // User clicked OK button
        }
    });
    builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            // User cancelled the dialog
            dialog.dismiss();
            finish();
        }
    });
    dialog = builder.create();
    dialog.show();

    dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialog) {
            finish();
        }
    });
}}

test.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:id="@+id/test"
android:layout_height="match_parent"></LinearLayout>
于 2016-05-31T06:58:41.927 に答える
0

このAssistive Touchのような、すべてのアプリの上で使用できるフローティング ボタンを探していますか、それともホーム画面でのみアクセスできるシンプルなフォルダを作成したいですか?

于 2016-05-31T07:17:24.793 に答える