本文介绍了Android Studio-应用未安装到手机上,但可以运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Android Studio在手机上运行我的应用程序,并且运行良好.但是应用程序本身从未安装过...菜单中没有图标.每当我要测试我的应用程序时,我都必须运行".我没有出现错误.

I use Android Studio to run my app on my phone and it runs fine. But the application itself is never installed...There is no icon for it in the menu. I have to "run" any time I want to test my app. I am presented with no errors.

我相信我的清单有问题.我在这里做错了什么?:

I believe there is an issue with my manifest. What am I doing wrong here?:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="jb854.eda.kent.ac.uk.edanews">

    <uses-feature
        android:name="android.software.leanback"
        android:required="false" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:name=".EDANewsApplication"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">
        <activity
            android:name=".activity.MainActivity"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <data android:scheme="http" android:host="www.eda.kent.ac.uk" android:pathPrefix="/school/"/>
            </intent-filter>

        </activity>
        <activity
            android:name=".activity.CommentsActivity"
            android:theme="@style/AppTheme.TransparentActivity" />
        <activity
            android:name=".activity.ArticleActivity"
            android:theme="@style/AppTheme.TransparentActivity" />
        <activity
            android:name=".activity.FullscreenImageActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/title_activity_fullscreen_image"
            android:theme="@style/AppTheme.TransparentActivity" />
        <activity
            android:name=".activity.FavouritesActivity"
            android:label="@string/title_activity_favourites"
            android:theme="@style/AppTheme.TransparentActivity" />

    </application>
</manifest>

推荐答案

您应在MainActivity中添加类别LAUNCHER和操作MAIN:

You should add category LAUNCHER and action MAIN to your MainActivity:

<activity
    android:name=".activity.MainActivity"
    android:windowSoftInputMode="adjustResize">
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <action android:name="android.intent.action.MAIN"/>

        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <category android:name="android.intent.category.LAUNCHER"/>

        <data android:scheme="http" android:host="www.eda.kent.ac.uk" android:pathPrefix="/school/"/>
    </intent-filter>

</activity>

这篇关于Android Studio-应用未安装到手机上,但可以运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 10:37