Category Archives: Android Studio

777 views

App have transparent menu Android

If the app have transparent menu and you do not want this, try delete @style/AppTheme in application tag in AndroidManifest.xml and try run module – project. If menu is not transparent , maybe it caused <application android:allowBackup="true" android:icon="@drawable/dicts_ico" android:label="@string/app_name" android:theme="@style/AppTheme" … Continue reading

Posted in Android Examples Code, Android Studio, Bugs, warnings, errors | Tagged | Comments Off on App have transparent menu Android
728 views

How rebuild only one module in project Android Studio

If you do click on Rebuid project menu item, this operation maybe consume long time on slovly PC. Some errors dismis when you do rebuild project, or module. Try this: Select module where contains red error code and press Debugg … Continue reading

Posted in Android Studio, Bugs, warnings, errors | Comments Off on How rebuild only one module in project Android Studio
688 views

Android Studio gradle file comment same as java comment

// single line /* multi line */

Posted in Android Examples Code, Android Studio | Comments Off on Android Studio gradle file comment same as java comment
711 views

Save Instance State if device is rotated

Try this trick. In AndroidManifest – activity tag write this code android:configChanges=”keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize” App hold data of a views if will to rotation of device. <activity android:name=".Tests_Activity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

Posted in Android Examples Code, Android Studio | Tagged | Comments Off on Save Instance State if device is rotated
928 views

Resources NotFoundException: File res/drawable/abc_btn_radio_on_mtrl.xml

If you make a new RadioButton and gradle istruction have compile ‘com.android.support:appcompat-v7:23.2.0′ try to change RadioButton into AppCompatRadioButton (context); RadioButton rb = new AppCompatRadioButton (context);

Posted in Android Studio, Bugs, warnings, errors | Tagged | Comments Off on Resources NotFoundException: File res/drawable/abc_btn_radio_on_mtrl.xml
2,107 views

No executable code found at line – omits breakpoints

No executable code found at line …. Try one from this solution: 1.) uninstall app from test device, try to debugg app or 2.) open module gradle file and set minifyEnabled to false in debug condition debug { minifyEnabled false … Continue reading

Posted in Android Studio, Bugs, warnings, errors | Tagged | Comments Off on No executable code found at line – omits breakpoints
818 views

Interstitial ads admob onCreate Android example code

private InterstitialAd mInterstitialAd; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);     //Caused by: java.lang.IllegalStateException: The ad unit ID must be set on InterstitialAd before loadAd is called. mInterstitialAd = new InterstitialAd(this); mInterstitialAd.setAdUnitId("ca-app-pub-3940256099942544/1033173712"); // Put your number!!!!   // some … Continue reading

Posted in Android Examples Code, Android Studio | Comments Off on Interstitial ads admob onCreate Android example code
830 views

Proguard Android Studio

http://developer.android.com/tools/help/proguard.html If make signed apk, open file build.gradle in the module folder. Set minifyEnabled to true http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Running-ProGuard buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile(’proguard-android.txt’), ‘proguard-rules.pro’ } } Check if the file exists in the module folder proguard-rules.pro c:\Users\meFolder\AndroidStudioProjects\MyProject\myModule\proguard-rules.pro Android … Continue reading

Posted in Android Studio | Tagged | Comments Off on Proguard Android Studio
630 views

Imported module not visible in project explorer Android Studio

Imported module not visible in project explorer Android Studio but exist in project folder. Gradle sync failed: Cause: failed to find target with hash string ‘android-20′ in: C:\Users\jas\AppData\Local\Android\sdk android-20 is for example! Open file in existing module named build.gradle is … Continue reading

Posted in Android Studio, Bugs, warnings, errors | Tagged | Comments Off on Imported module not visible in project explorer Android Studio
704 views

Resource Entry already defined

Check if in drawable folder have two picture with same name and delete one. For example: image_1.jpg image_1.png Check the module build folder in Android Studio for two files with same names. C:\Users\myFolder\AndroidStudioProjects\Project\yourModule\build\intermediates\res\merged\debug\drawable\

Posted in Android Studio, Bugs, warnings, errors | Tagged | Comments Off on Resource Entry already defined