Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

at java.util.Arrays$ArrayList.get(Arrays.java:75)


Problem in Android application:

E/AndroidRuntime(416): FATAL EXCEPTION: main
E/AndroidRuntime(416): java.lang.IndexOutOfBoundsException
E/AndroidRuntime(416): 	at java.util.Arrays$ArrayList.get(Arrays.java:75)
E/AndroidRuntime(416): 	at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:298)
E/AndroidRuntime(416): 	at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:351)
E/AndroidRuntime(416): 	at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
E/AndroidRuntime(416): 	at android.widget.Spinner.makeAndAddView(Spinner.java:192)
E/AndroidRuntime(416): 	at android.widget.Spinner.layout(Spinner.java:151)
E/AndroidRuntime(416): 	at android.widget.Spinner.onLayout(Spinner.java:115)

Solution: check code for set and get selection

// Spinner _spin1 contain only  49 items 
// you can set max 48 ( range 0 - 48)
// 50 is IndexOutOfBoundsException

397LW NO topic_id


Další témata ....(Topics)


App have transparent menu Android | 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

        android:theme="@style/AppTheme" // delete this row - run app - try menu

Or try set values\styles.xml into basic Theme


        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
    <style name="AppBaseTheme" parent="android:Theme.Black">
            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
        <!-- All customizations that are NOT specific to a particular API-level can go here. -->



Permission settings of Android application example | permission-settings-of-android-application-example

In your project AndroidManifest.xml you can set permission of Android application example source code.
For example if you want allow your application connection to INTERNET you have to permit this in AndroidManifest.xml.
WebViev show error: Website Not Available you have to permit INTERNET

        android:name="android.permission.INTERNET" />
        android:name="android.permission.GET_ACCOUNTS" />
        android:name="android.permission.USE_CREDENTIALS" />
        android:name="android.permission.MANAGE_ACCOUNTS" />
        android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
        android:name="android.permission.WRITE_SETTINGS" />
        android:name="android.permission.WRITE_SECURE_SETTINGS" />
        android:name="android.permission.READ_CONTACTS" />
        android:name="android.permission.WRITE_CONTACTS" />
        android:name="android.permission.READ_SYNC_STATS" />
        android:name="android.permission.READ_SYNC_SETTINGS" />
        android:name="android.permission.WRITE_SYNC_SETTINGS" />

Importing google-play-service library project to workspace issue | importing-google-play-service-library-project-to-workspace-issue

Try two way in Eclipse IDE:

1.) Import the library project into your Eclipse workspace.
Click File > Import,
select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
If project not visible with checkbox try next step as see below.

2.) Click
File > New > Other
select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.

Error type 3 Activity class does not exist | error-type-3-activity-class-does-not-exist

Try some solution - each individually or all

  1. Check AndroidManifest.xml activity declaration
                android:label="@string/app_name" />

  2. Delete BUILD folder in module tree and Clean / Rebuild project

  3. Restart Android Studio


Android Google Maps Night Mode | android-google-maps-night-mode

If you want save battery, select "Satelite map" from map menu and reduce the brightness of the display.


Editace: 2014-02-15 20:32:53
Počet článků v kategorii: 397

11 Share