1

I'm using android studio 1.3 , I'm running/debugging my app on my Nexus 5 - works great but after exiting the app - I cant find my app on the device.. so actually every time I want to run it I need to connect my device to the studio and run...

It happened suddenly , in the past I ran the program and it did! Stay on the device Tried on different devices.

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "app.meantneat.com.meetneat"
        minSdkVersion 17
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()

    maven {
        url 'http://lorenzo.villani.me/android-cropimage/'
    }
}

dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services:7.3.0'
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
    //compile 'com.getbase:floatingactionbutton:1.9.0'
    //compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.melnykov:floatingactionbutton:1.3.0'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'me.villani.lorenzo.android:android-cropimage:1.1.0'
    compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'




    //compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    //compile 'com.google.android.gms:play-services:7.3.0'
}

Any help would be greatly appreciated.Thanks, Dan

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
DaNLtR
  • 561
  • 5
  • 21

1 Answers1

5

In your Manifest mark one of your activity as launcher activity :

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name">

        <intent-filter>
            <category android:name="android.intent.category.LAUNCHER" />
            <action android:name="android.intent.action.MAIN"/>
        </intent-filter>
    </activity>
Harish Sridharan
  • 1,070
  • 6
  • 10
  • thats what i have: – DaNLtR Aug 04 '15 at 11:28
  • @HarishSridharan is correct. You have to mention inside Intent Filter of your activity an action as "android.intent.action.MAIN". The Android System looks for this "action" inside all the activities of the installed Apps, when launching the Application Launcher. – Prashant Aug 04 '15 at 12:05
  • added android.intent.action.MAIN - works! THANK YOU!! – DaNLtR Aug 04 '15 at 12:12
  • @HarishSridharan in case if "android.intent.action.MAIN is not set the app will not launch any activity!! or will it? – P-RAD Aug 04 '15 at 13:56
  • @Dev It will. The usage of MAIN is to indicate the android OS to consider the particular activity when the OS will be querying all the application to get the entry points. A device will have # of apps and each app will itself have huge number of activities, it can't be searching every activity whether to enter or not for a particular purpose. Thus comes the purpose of MAIN. In simple terms, android OS will query only the MAIN activities when it needs to gain an entry access to an application. You may also read this answer - http://stackoverflow.com/a/25219614/3894784 – Harish Sridharan Aug 04 '15 at 14:58