简体   繁体   中英

There is something wrong with My Android Studio when creating a new default application.I'm new to use it

When using Android Studio(1.4.1) to create a new application,the activity is the default Blank Activity,also the activtiy_main.xml is default,it contains android.support.design.widget.xxx,but the preview show nothing,what can I do to solve this.

  apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.buaa.arvin.myapplication"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:design:22.2.1'
}

From Android Studio 1.4+

Blank Activity is Empty Activity

If you really intent to use blank activity go for empty activity, It'll works just fine.

If you want more customization to handle by default you go for blank activity and other activity types from the gallery

And to resolve your issue

post your gradle code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM