简体   繁体   English

应用程式未在启动器中显示

[英]App doesn't show in launcher

When I debug/ test my app from Android Studio on my phone. 在手机上通过Android Studio调试/测试我的应用时。 I don't see it in my launcher or can't even find the app by searching. 我在启动器中看不到它,甚至无法通过搜索找到该应用程序。 It's something to do with Android Manifest right? 这与Android Manifest有关吗? And I don't think I made it 'launcher activity'. 而且我不认为我是“发起人活动”。 Would you please be able to help me? 您能帮我吗? Thanks! 谢谢!

EDIT: 编辑:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.gursimran.bedi.eta" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

MainActivity.java MainActivity.java

package com.gursimran.bedi.eta;

import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    String TITLES[] = {"Home","Events","Mail","Shop","Travel"};
    int ICONS[] = {R.drawable.ic_alarm_add_black_48dp, R.drawable.ic_check_circle_black_48dp,
            R.drawable.ic_delete_black_48dp, R.drawable.ic_dns_black_48dp,R.drawable.ic_favorite_border_black_48dp};

    private Toolbar toolbar;

    RecyclerView mRecyclerView;                           // Declaring RecyclerView
    RecyclerView.Adapter mAdapter;                        // Declaring Adapter For Recycler View
    RecyclerView.LayoutManager mLayoutManager;            // Declaring Layout Manager as a linear layout manager
    DrawerLayout Drawer;                                  // Declaring DrawerLayout

    ActionBarDrawerToggle mDrawerToggle;

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

        toolbar = (Toolbar) findViewById(R.id.tool_bar);
        setSupportActionBar(toolbar);

        getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(true);

        NavigationDrawerFragment drawerFragment = (NavigationDrawerFragment)
                getSupportFragmentManager().findFragmentById(R.id.fragment_navigation_drawer);

        drawerFragment.setUp(R.id.fragment_navigation_drawer, (DrawerLayout)findViewById(R.id.DrawerLayout), toolbar);

        mRecyclerView = (RecyclerView) findViewById(R.id.RecyclerView); // Assigning the RecyclerView Object to the xml View
        mRecyclerView.setHasFixedSize(true);                            // Letting the system know that the list objects are of fixed size
      //  mAdapter = new MyAdapter(TITLES,ICONS,NAME,EMAIL,PROFILE);       // Creating the Adapter of MyAdapter class(which we are going to see in a bit)
        // And passing the titles,icons,header view name, header view email,
        // and header view profile picture

        mRecyclerView.setAdapter(mAdapter);                              // Setting the adapter to RecyclerView

        mLayoutManager = new LinearLayoutManager(this);                 // Creating a layout Manager

        mRecyclerView.setLayoutManager(mLayoutManager);                 // Setting the layout Manager


        Drawer = (DrawerLayout) findViewById(R.id.DrawerLayout);        // Drawer object Assigned to the view
        mDrawerToggle = new ActionBarDrawerToggle(this,Drawer,toolbar,R.string.drawer_open,R.string.drawer_closed){

            @Override
            public void onDrawerOpened(View drawerView) {
                super.onDrawerOpened(drawerView);
                // code here will execute once the drawer is opened( As I dont want anything happened whe drawer is
                // open I am not going to put anything here)
            }

            @Override
            public void onDrawerClosed(View drawerView) {
                super.onDrawerClosed(drawerView);
                // Code here will execute once drawer is closed
            }



        }; // Drawer Toggle Object Made
        Drawer.setDrawerListener(mDrawerToggle); // Drawer Listener set to the Drawer toggle
        mDrawerToggle.syncState();               // Finally we set the drawer toggle sync State


    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

@Gursimram Bedi : @Gursimram Bedi:

For your kind information .Try this way 供您参考。尝试这种方式

Clean and Rebuild your Project Then Restart your Project Too. 清理并重建您的项目,然后重新启动您的项目。

Actually your manifest is perfect. 实际上,您的清单是完美的。

Let me inform me .I hope it will helps you. 让我通知我。希望对您有所帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 flutter 启动器图标的问题,成功安装后它不会在我的 android 设备中显示启动器图标 - issue with flutter launcher icons, after successfully installed it doesn't show the launcher icons in my android device 使用产品口味时,应用程序名称不会在启动器中更改 - App name doesn't change in launcher when using product flavors 为什么此Glass应用程序没有出现在Glass Launcher中? - Why doesn't this Glass app appear in the Glass Launcher? Android应用程序未在启动器中显示 - Android App do not show in launcher Android 2.3.3(Windows)模拟器在启动时不会显示手机桌面。 遇到重复的启动器(com.android.launcher)错误 - Android 2.3.3 (Windows) emulator doesn't show the phone desktop on startup. Getting a repeated Launcher (com.android.launcher) error Android Studio未安装带有启动器的应用,该应用仅在应用设置中可见 - Android Studio doesn't install app with launcher, app only visible in app settings 更新Android应用的启动器图标以显示通知 - Update launcher icon of an Android app to show notification Android-调用CAPTURE_IMAGE意向并拍照后,应用进入启动器(不返回片段) - Android - app goes to launcher after calling CAPTURE_IMAGE intent and taking picture (doesn't return to the fragment) 启动器活动改变了这就是为什么FCM推送通知在后台应用程序时不起作用的原因 - Launcher Activity changed that's why FCM Push Notification doesn't work while app in background 为什么应用程序包中的 apk 在某些设备上没有启动器图标 - Why apk from app bundle doesn't have launcher icon on some devices
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM