NoSuchMethodError when setting a custom progress bar

Georgi Koemdzhiev

I am using a custom progress bar and it works on my physical phone just fine. However, I am created a tablet layout of my app and tried it on an emulator and it gives me this error message - NoSuchMethodError
Here is the piece of code where I am setting my custom progress bar: line 34 is where I am setting the interterminateDrawable. The minimum sdks version is 14

mProgressBar = (ProgressBar) findViewById(R.id.progressBar);
    mProgressBar.setVisibility(View.INVISIBLE);
    mProgressBar.setIndeterminateDrawable(getDrawable(R.drawable.progress));

Here is the log:

java.lang.NoSuchMethodError: koemdzhiev.com.blinkmessage.LoginActivity.getDrawable
        at koemdzhiev.com.blinkmessage.LoginActivity.onCreate(LoginActivity.java:34)
        at android.app.Activity.performCreate(Activity.java:5008)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
        at android.app.ActivityThread.access$600(ActivityThread.java:130)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4745)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        at dalvik.system.NativeStart.main(Native Method)
CommonsWare

The getDrawable() convenience method on Context was added in API Level 21. Your tablet may be running an older version.

The minimum sdks version is 14

The build tools should have complained about your use of getDrawable() here. Either raise your minSdkVersion to 21, or use something else, such as the getDrawable() method on Resources (and you can get a Resources by calling getResources() on your activity).

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Android custom progress bar with .gif file

분류에서Dev

Custom progress bar using YouTube API

분류에서Dev

Splash screen with progress bar

분류에서Dev

progress bar not working for me

분류에서Dev

Progress bar not updating on Android

분류에서Dev

Refresh progress bar

분류에서Dev

Display Upload Progress in Modal with Bootstrap Progress Bar

분류에서Dev

Setting label text in a UICollectionViewCell not working when string is passed to custom class

분류에서Dev

Put border in empty progress bar

분류에서Dev

Using an indeterminate progress bar with a listview

분류에서Dev

Progress-bar for Ruby Upload

분류에서Dev

Progress bar at every GridView element

분류에서Dev

youtube-dl file download progress with zenity progress bar

분류에서Dev

Displaying progress bar while intent service is running

분류에서Dev

Updating progress bar asynchronously using TPL

분류에서Dev

How can I Display a Progress Bar in mplayer?

분류에서Dev

conflict betwen dplyr and progress bar (shinyIncubator)

분류에서Dev

implementing progress bar in wpf window with viewmodel

분류에서Dev

Javascript long term progress bar like Kickstarter

분류에서Dev

How to create Vertical progress bar in Bootstrap with

분류에서Dev

Linux + how to create simple Progress Bar in bash

분류에서Dev

Is there Windows 8 copy progress bar for Nautilus?

분류에서Dev

Custom bar chart text with Highcharts

분류에서Dev

Android show progress bar while image loading dynamically

분류에서Dev

C# How to loop through Progress Bar perfectly

분류에서Dev

How can I put progress bar component on top of the layout?

분류에서Dev

Backgroundworker doesn't update progress bar in separate window

분류에서Dev

while progress bar is running how to disable other controls of the page in WPF

분류에서Dev

What does the orange bouncing thing in the progress bar in VLC mean?

Related 관련 기사

  1. 1

    Android custom progress bar with .gif file

  2. 2

    Custom progress bar using YouTube API

  3. 3

    Splash screen with progress bar

  4. 4

    progress bar not working for me

  5. 5

    Progress bar not updating on Android

  6. 6

    Refresh progress bar

  7. 7

    Display Upload Progress in Modal with Bootstrap Progress Bar

  8. 8

    Setting label text in a UICollectionViewCell not working when string is passed to custom class

  9. 9

    Put border in empty progress bar

  10. 10

    Using an indeterminate progress bar with a listview

  11. 11

    Progress-bar for Ruby Upload

  12. 12

    Progress bar at every GridView element

  13. 13

    youtube-dl file download progress with zenity progress bar

  14. 14

    Displaying progress bar while intent service is running

  15. 15

    Updating progress bar asynchronously using TPL

  16. 16

    How can I Display a Progress Bar in mplayer?

  17. 17

    conflict betwen dplyr and progress bar (shinyIncubator)

  18. 18

    implementing progress bar in wpf window with viewmodel

  19. 19

    Javascript long term progress bar like Kickstarter

  20. 20

    How to create Vertical progress bar in Bootstrap with

  21. 21

    Linux + how to create simple Progress Bar in bash

  22. 22

    Is there Windows 8 copy progress bar for Nautilus?

  23. 23

    Custom bar chart text with Highcharts

  24. 24

    Android show progress bar while image loading dynamically

  25. 25

    C# How to loop through Progress Bar perfectly

  26. 26

    How can I put progress bar component on top of the layout?

  27. 27

    Backgroundworker doesn't update progress bar in separate window

  28. 28

    while progress bar is running how to disable other controls of the page in WPF

  29. 29

    What does the orange bouncing thing in the progress bar in VLC mean?

뜨겁다태그

보관