RemoteViews werden ab Android 5.1 nicht mehr angezeigt

  • Antworten:9
  • OffenNicht stickyNicht beantwortet
  • Forum-Beiträge: 9

28.05.2016, 12:47:05 via Website

Hallo liebe Androidpit Mitglider

Ich habe ein Akku Widget das bis Android 5.0 (Api 21) wunderbar lief. Alles über api 21 geht nicht. Ich habe google schon auf Herz und Nieren abgefragt.

Desweitern habe ich die Frage auch in anderen Foren gestellt aber bis jetzt weiß keiner was mein Problem ist.

Ich fang eifach mal mit der Manifest an :<?xml version="1.0" encoding="utf-8"?>
package="de.platzhalter"
android:versionCode="2"
android:versionName="1.1" >

<uses-permission android:name="android.permission.BATTERY_STATS"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<application android:label="@string/app_name" android:icon="@drawable/battery"
             android:allowBackup="false">
        <receiver android:icon="@drawable/battery"
                android:label="@string/app_name"
                android:name=".Battery">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
                <action android:name="android.intent.action.BATTERY_CHANGED"/>
            </intent-filter>
            <meta-data android:name="android.appwidget.provider"
            android:resource="@xml/battery_widget_info"/>
        </receiver>

`

Und hier mal ein Teil meiner Klasse :

public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) 
{

      ComponentName meinWidget = new ComponentName(context,
                Battery.class);

              for (int widgetId : appWidgetManager.getAppWidgetIds(meinWidget)) {

               //remote view holen
               RemoteViews remoteViews = new RemoteViews(context.getPackageName(),
                 R.layout.battery_widget);


               //remoteViews.setTextViewText(R.id.text_level, Utility.getCurrentTime("hh:mm:ss a"));
               remoteViews.setImageViewResource(R.id.oben1, 0);
               remoteViews.setImageViewResource(R.id.oben2, 0);
               remoteViews.setImageViewResource(R.id.oben3, 0);
               remoteViews.setImageViewResource(R.id.oben4, 0);
               remoteViews.setImageViewResource(R.id.obenrechts1, 0);
               remoteViews.setImageViewResource(R.id.obenrechts2, 0);
               remoteViews.setImageViewResource(R.id.obenrechts3, 0);
               remoteViews.setImageViewResource(R.id.obenrechts4, 0);
               remoteViews.setImageViewResource(R.id.obenrechts2_1, 0);
               remoteViews.setImageViewResource(R.id.obenrechts2_2, 0);
               remoteViews.setImageViewResource(R.id.obenrechts2_3, 0);
               remoteViews.setImageViewResource(R.id.obenrechts2_4, 0);
               remoteViews.setImageViewResource(R.id.obenrechts3_1, 0);
               remoteViews.setImageViewResource(R.id.obenrechts3_2, 0);
               remoteViews.setImageViewResource(R.id.obenrechts3_3, 0);
               remoteViews.setImageViewResource(R.id.obenrechts3_4, 0);
               remoteViews.setImageViewResource(R.id.rechts1, 0);
               remoteViews.setImageViewResource(R.id.rechts2, 0);
               remoteViews.setImageViewResource(R.id.rechts3, 0);
               remoteViews.setImageViewResource(R.id.rechts4, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten3_1, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten3_2, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten3_3, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten3_4, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten2_1, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten2_2, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten2_3, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten2_4, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten1_1, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten1_2, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten1_3, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten1_4, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten1, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten2, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten3, 0);
               remoteViews.setImageViewResource(R.id.rechtsunten4, 0);
               remoteViews.setImageViewResource(R.id.unten1, 0);
               remoteViews.setImageViewResource(R.id.unten2, 0);
               remoteViews.setImageViewResource(R.id.unten3, 0);
               remoteViews.setImageViewResource(R.id.unten4, 0);
               remoteViews.setImageViewResource(R.id.untenlinks1, 0);
               remoteViews.setImageViewResource(R.id.untenlinks2, 0);
               remoteViews.setImageViewResource(R.id.untenlinks3, 0);
               remoteViews.setImageViewResource(R.id.untenlinks4, 0);
               remoteViews.setImageViewResource(R.id.untenlinks2_1, 0);
               remoteViews.setImageViewResource(R.id.untenlinks2_2, 0);
               remoteViews.setImageViewResource(R.id.untenlinks2_3, 0);
               remoteViews.setImageViewResource(R.id.untenlinks2_4, 0);
               remoteViews.setImageViewResource(R.id.untenlinks3_1, 0);
               remoteViews.setImageViewResource(R.id.untenlinks3_2, 0);
               remoteViews.setImageViewResource(R.id.untenlinks3_3, 0);
               remoteViews.setImageViewResource(R.id.untenlinks3_4, 0);
               remoteViews.setImageViewResource(R.id.links1, 0);
               remoteViews.setImageViewResource(R.id.links2, 0);
               remoteViews.setImageViewResource(R.id.links3, 0);
               remoteViews.setImageViewResource(R.id.links4, 0);
               remoteViews.setImageViewResource(R.id.linksoben3_1, 0);
               remoteViews.setImageViewResource(R.id.linksoben3_2, 0);
               remoteViews.setImageViewResource(R.id.linksoben3_3, 0);
               remoteViews.setImageViewResource(R.id.linksoben3_4, 0);
               remoteViews.setImageViewResource(R.id.linksoben2_1, 0);
               remoteViews.setImageViewResource(R.id.linksoben2_2, 0);
               remoteViews.setImageViewResource(R.id.linksoben2_3, 0);
               remoteViews.setImageViewResource(R.id.linksoben2_4, 0);
               remoteViews.setImageViewResource(R.id.obenlinks1, 0);
               remoteViews.setImageViewResource(R.id.obenlinks2, 0);
               remoteViews.setImageViewResource(R.id.obenlinks3, 0);
               remoteViews.setImageViewResource(R.id.obenlinks4, 0);
               remoteViews.setImageViewResource(R.id.untenlinks1_1, 0);
               remoteViews.setImageViewResource(R.id.untenlinks1_2, 0);
               remoteViews.setImageViewResource(R.id.untenlinks1_3, 0);
               remoteViews.setImageViewResource(R.id.untenlinks1_4, 0);
               appWidgetManager.updateAppWidget(widgetId, remoteViews);
              }





    Intent received = context.getApplicationContext().registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));

    assert received != null;
    String receivedAction = received.getAction();

    if (receivedAction.equals(Intent.ACTION_BATTERY_CHANGED)) 
    {

        int level = received.getIntExtra("level", 0); 

           this.widgetViews.setImageViewResource(R.id.oben1, 0);
           this.widgetViews.setImageViewResource(R.id.oben2, 0);
           this.widgetViews.setImageViewResource(R.id.oben3, 0);
           this.widgetViews.setImageViewResource(R.id.oben4, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts1, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts2, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts3, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts4, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts2_1, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts2_2, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts2_3, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts2_4, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts3_1, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts3_2, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts3_3, 0);
           this.widgetViews.setImageViewResource(R.id.obenrechts3_4, 0);
           this.widgetViews.setImageViewResource(R.id.rechts1, 0);
           this.widgetViews.setImageViewResource(R.id.rechts2, 0);
           this.widgetViews.setImageViewResource(R.id.rechts3, 0);
           this.widgetViews.setImageViewResource(R.id.rechts4, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten3_1, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten3_2, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten3_3, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten3_4, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten2_1, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten2_2, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten2_3, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten2_4, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten1_1, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten1_2, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten1_3, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten1_4, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten1, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten2, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten3, 0);
           this.widgetViews.setImageViewResource(R.id.rechtsunten4, 0);
           this.widgetViews.setImageViewResource(R.id.unten1, 0);
           this.widgetViews.setImageViewResource(R.id.unten2, 0);
           this.widgetViews.setImageViewResource(R.id.unten3, 0);
           this.widgetViews.setImageViewResource(R.id.unten4, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks1, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks2, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks3, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks4, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks1_1, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks1_2, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks1_3, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks1_4, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks2_1, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks2_2, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks2_3, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks2_4, 0);
           this.widgetViews.setImageViewResource(R.id.links1, 0);
           this.widgetViews.setImageViewResource(R.id.links2, 0);
           this.widgetViews.setImageViewResource(R.id.links3, 0);
           this.widgetViews.setImageViewResource(R.id.links4, 0);
           this.widgetViews.setImageViewResource(R.id.linksoben3_1, 0);
           this.widgetViews.setImageViewResource(R.id.linksoben3_2, 0);
           this.widgetViews.setImageViewResource(R.id.linksoben3_3, 0);
           this.widgetViews.setImageViewResource(R.id.linksoben3_4, 0);
           this.widgetViews.setImageViewResource(R.id.linksoben2_1, 0);
           this.widgetViews.setImageViewResource(R.id.linksoben2_2, 0);
           this.widgetViews.setImageViewResource(R.id.linksoben2_3, 0);
           this.widgetViews.setImageViewResource(R.id.linksoben2_4, 0);
           this.widgetViews.setImageViewResource(R.id.obenlinks1, 0);
           this.widgetViews.setImageViewResource(R.id.obenlinks2, 0);
           this.widgetViews.setImageViewResource(R.id.obenlinks3, 0);
           this.widgetViews.setImageViewResource(R.id.obenlinks4, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks3_1, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks3_2, 0);
           this.widgetViews.setImageViewResource(R.id.untenlinks3_3,0);
           this.widgetViews.setImageViewResource(R.id.untenlinks3_4,0);

            //call helper to show the level bars
        showBars(level);

            //get component to update
        ComponentName appComponent = new ComponentName(context, Battery.class);
            //update the widget
        AppWidgetManager.getInstance(context).updateAppWidget(appComponent, this.widgetViews);

    }
    //Toast.makeText(context, "onUpdate() called", Toast.LENGTH_SHORT).show();

}



 @Override
 public void onDeleted(Context context, int[] appWidgetIds) {
  Toast.makeText(context, "Bitte warten", Toast.LENGTH_SHORT).show();
  super.onDeleted(context, appWidgetIds);
 }


@Override
 public void onDisabled(Context context) {
  Toast.makeText(context, Battery wurde entfernt", Toast.LENGTH_SHORT).show();
  Intent intent = new Intent(context, AlarmManagerBroadcastReceiver.class);
  PendingIntent sender = PendingIntent.getBroadcast(context, 0, intent, 0);
  AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
  alarmManager.cancel(sender);
  super.onDisabled(context);
 }


 @Override
 public void onEnabled(Context context) {
  super.onEnabled(context);
  AlarmManager alarmM=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  Intent intent = new Intent(context, AlarmManagerBroadcastReceiver.class);
  PendingIntent pendingI = PendingIntent.getBroadcast(context, 0, intent, 0);

     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
         alarmM.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP,System.currentTimeMillis() + 5000,pendingI);
         //alarmM.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP,System.currentTimeMillis() + 5000,pendingI);
         Toast.makeText(context, "onEnabled called setAndAllowWhileIdle", Toast.LENGTH_SHORT).show();
     }
     alarmM.setRepeating(AlarmManager.RTC_WAKEUP,System.currentTimeMillis() + 1000 * 4, 60000,pendingI);
 }


 @Override
 public void onAppWidgetOptionsChanged(Context context,
   AppWidgetManager appWidgetManager, int appWidgetId,
   Bundle newOptions) {

     this.widgetViews.setImageViewResource(R.id.oben1,0);
     this.widgetViews.setImageViewResource(R.id.oben2, 0);
     this.widgetViews.setImageViewResource(R.id.oben3, 0);
     this.widgetViews.setImageViewResource(R.id.oben4, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts1, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts2, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts3, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts4, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts2_1, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts2_2, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts2_3, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts2_4, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts3_1, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts3_2, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts3_3, 0);
     this.widgetViews.setImageViewResource(R.id.obenrechts3_4, 0);
     this.widgetViews.setImageViewResource(R.id.rechts1, 0);
     this.widgetViews.setImageViewResource(R.id.rechts2, 0);
     this.widgetViews.setImageViewResource(R.id.rechts3, 0);
     this.widgetViews.setImageViewResource(R.id.rechts4, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten3_1, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten3_2, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten3_3, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten3_4, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten2_1, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten2_2, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten2_3, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten2_4, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten1_1, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten1_2, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten1_3, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten1_4, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten1, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten2, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten3, 0);
     this.widgetViews.setImageViewResource(R.id.rechtsunten4, 0);
     this.widgetViews.setImageViewResource(R.id.unten1, 0);
     this.widgetViews.setImageViewResource(R.id.unten2, 0);
     this.widgetViews.setImageViewResource(R.id.unten3, 0);
     this.widgetViews.setImageViewResource(R.id.unten4, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks1, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks2, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks3, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks4, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks1_1, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks1_2, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks1_3, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks1_4, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks2_1, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks2_2, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks2_3, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks2_4, 0);
     this.widgetViews.setImageViewResource(R.id.links1, 0);
     this.widgetViews.setImageViewResource(R.id.links2, 0);
     this.widgetViews.setImageViewResource(R.id.links3, 0);
     this.widgetViews.setImageViewResource(R.id.links4, 0);
     this.widgetViews.setImageViewResource(R.id.linksoben3_1, 0);
     this.widgetViews.setImageViewResource(R.id.linksoben3_2, 0);
     this.widgetViews.setImageViewResource(R.id.linksoben3_3, 0);
     this.widgetViews.setImageViewResource(R.id.linksoben3_4, 0);
     this.widgetViews.setImageViewResource(R.id.linksoben2_1, 0);
     this.widgetViews.setImageViewResource(R.id.linksoben2_2, 0);
     this.widgetViews.setImageViewResource(R.id.linksoben2_3, 0);
     this.widgetViews.setImageViewResource(R.id.linksoben2_4, 0);
     this.widgetViews.setImageViewResource(R.id.obenlinks1, 0);
     this.widgetViews.setImageViewResource(R.id.obenlinks2, 0);
     this.widgetViews.setImageViewResource(R.id.obenlinks3, 0);
     this.widgetViews.setImageViewResource(R.id.obenlinks4, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks3_1, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks3_2, 0);
     this.widgetViews.setImageViewResource(R.id.untenlinks3_3,0);
     this.widgetViews.setImageViewResource(R.id.untenlinks3_4, 0);
  //Toast.makeText(context, "onAppWidgetOptionsChanged() called", Toast.LENGTH_SHORT).show();
 }









private void showBars(int currLevel)
{
        /*
         * 
         * 
         * Das ist 1% von 100 : 1.388888888888889
         */
    if(currLevel == 100)
    {
        this.widgetViews.setImageViewResource(R.id.oben1, 0);
        this.widgetViews.setViewVisibility(R.id.oben1, View.VISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=97.9999991111111)
    {
        this.widgetViews.setImageViewResource(R.id.oben2, 0);
        this.widgetViews.setViewVisibility(R.id.oben2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.oben2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=97.22222222222222)
    {
        this.widgetViews.setImageViewResource(R.id.oben3, 0);
        this.widgetViews.setViewVisibility(R.id.oben3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.oben3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=95.33333333333333)
    {
        this.widgetViews.setImageViewResource(R.id.oben4,0);
        this.widgetViews.setViewVisibility(R.id.oben4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.oben4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=95.13333333333333)
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts1,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    if(currLevel>=93.05555555555556)
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts2,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    if(currLevel>=91.66666666666667)
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts3,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    if(currLevel>=90.27777777777778)
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts4,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    if(currLevel>=88.88888888888889)
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts2_1,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts2_1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts2_1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    if(currLevel>=87.5)                                                          // 10 prozent
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts2_2,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts2_2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts2_2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=86.11111111111111)
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts2_3,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts2_3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts2_3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=84.72222222222222)
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts2_4,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts2_4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts2_4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=83.33333333333333)
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts3_1,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts3_1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts3_1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=81.94444444444444)
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts3_2,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts3_2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts3_2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=80.55555555555555)
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts3_3,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts3_3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts3_3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=79.16666666666667)
    {
        this.widgetViews.setImageViewResource(R.id.obenrechts3_4,0);
        this.widgetViews.setViewVisibility(R.id.obenrechts3_4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenrechts3_4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=77.77777777777778)
    {
        this.widgetViews.setImageViewResource(R.id.rechts1,0);
        this.widgetViews.setViewVisibility(R.id.rechts1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechts1, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=76.38888888888889)
    {
        this.widgetViews.setImageViewResource(R.id.rechts2,0);
        this.widgetViews.setViewVisibility(R.id.rechts2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechts2, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=75)                                                            // 20 prozent
    {
        this.widgetViews.setImageViewResource(R.id.rechts3,0);
        this.widgetViews.setViewVisibility(R.id.rechts3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechts3, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=73.61111111111111)
    {
        this.widgetViews.setImageViewResource(R.id.rechts4,0);
        this.widgetViews.setViewVisibility(R.id.rechts4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechts4, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=72.22222222222222)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten3_1,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten3_1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten3_1, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=70.83333333333333)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten3_2,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten3_2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten3_2, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=69.44444444444444)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten3_3,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten3_3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten3_3, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=68.05555555555555)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten3_4,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten3_4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten3_4, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=66.66666666666666)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten2_1,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten2_1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten2_1, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=65.27777777777778)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten2_2,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten2_2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten2_2, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=63.88888888888889)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten2_3,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten2_3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten2_3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=62.5)                                                          // 30 prozent
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten2_4,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten2_4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten2_4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=61.11111111111111)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten1_1,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten1_1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten1_1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=59.72222222222222)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten1_2,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten1_2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten1_2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=58.33333333333333)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten1_3,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten1_3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten1_3, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=56.94444444444444)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten1_4,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten1_4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten1_4, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=55.55555555555555)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten1,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten1, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=54.16666666666666)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten2,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten2, View.INVISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=52.77777777777777)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten3,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=51.38888888888889)
    {
        this.widgetViews.setImageViewResource(R.id.rechtsunten4,0);
        this.widgetViews.setViewVisibility(R.id.rechtsunten4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.rechtsunten4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=50)                                                             // 40 Prozent
    {
        this.widgetViews.setImageViewResource(R.id.unten1,0);
        this.widgetViews.setViewVisibility(R.id.unten1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.unten1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=48.61111111111111)
    {
        this.widgetViews.setImageViewResource(R.id.unten2,0);
        this.widgetViews.setViewVisibility(R.id.unten2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.unten2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=47.22222222222222)
    {
        this.widgetViews.setImageViewResource(R.id.unten3,0);
        this.widgetViews.setViewVisibility(R.id.unten3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.unten3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=45.83333333333333)
    {
        this.widgetViews.setImageViewResource(R.id.unten4,0);
        this.widgetViews.setViewVisibility(R.id.unten4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.unten4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=44.44444444444444)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks1,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=43.05555555555555)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks2,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=41.66666666666666)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks3,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=40.27777777777777)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks4,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=38.88888888888888)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks1_1,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks1_1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks1_1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=37.5)                                                           // 50 Prozent
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks1_2,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks1_2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks1_2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=36.11111111111111)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks1_3,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks1_3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks1_3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=34.72222222222222)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks1_4,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks1_4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks1_4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=33.33333333333333)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks2_1,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks2_1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks2_1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=31.94444444444444)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks2_2,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks2_2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks2_2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=30.55555555555555)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks2_3,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks2_3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks2_3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=29.16666666666666)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks2_4,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks2_4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks2_4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=27.77777777777777)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks3_1,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks3_1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks3_1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=26.38888888888888)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks3_2,0);
        this.widgetViews.setViewVisibility(R.id.untenlinks3_2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks3_2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=24.99999999999999)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks3_3, 0);
        this.widgetViews.setViewVisibility(R.id.untenlinks3_3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks3_3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=23.61111111111111)
    {
        this.widgetViews.setImageViewResource(R.id.untenlinks3_4, 0);
        this.widgetViews.setViewVisibility(R.id.untenlinks3_4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.untenlinks3_4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=22.22222222222222)
    {
        this.widgetViews.setImageViewResource(R.id.links1, 0);
        this.widgetViews.setViewVisibility(R.id.links1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.links1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=20.83333333333333)
    {
        this.widgetViews.setImageViewResource(R.id.links2, 0);
        this.widgetViews.setViewVisibility(R.id.links2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.links2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=19.44444444444444)
    {
        this.widgetViews.setImageViewResource(R.id.links3, 0);
        this.widgetViews.setViewVisibility(R.id.links3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.links3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=18.05555555555555)
    {
        this.widgetViews.setImageViewResource(R.id.links4, 0);
        this.widgetViews.setViewVisibility(R.id.links4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.links4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=16.66666666666666)
    {
        this.widgetViews.setImageViewResource(R.id.linksoben3_1, 0);
        this.widgetViews.setViewVisibility(R.id.linksoben3_1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.linksoben3_1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=15.27777777777777)
    {
        this.widgetViews.setImageViewResource(R.id.linksoben3_2, 0);
        this.widgetViews.setViewVisibility(R.id.linksoben3_2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.linksoben3_2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=13.88888888888888)
    {
        this.widgetViews.setImageViewResource(R.id.linksoben3_3, 0);
        this.widgetViews.setViewVisibility(R.id.linksoben3_3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.linksoben3_3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=12.49999999999999)
    {
        this.widgetViews.setImageViewResource(R.id.linksoben3_4, 0);
        this.widgetViews.setViewVisibility(R.id.linksoben3_4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.linksoben3_4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=11.1111111111111)
    {
        this.widgetViews.setImageViewResource(R.id.linksoben2_1, 0);
        this.widgetViews.setViewVisibility(R.id.linksoben2_1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    }
    else
        this.widgetViews.setViewVisibility(R.id.linksoben2_1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    if(currLevel>=9.722222222222215)
    {
        this.widgetViews.setImageViewResource(R.id.linksoben2_2, 0);
        this.widgetViews.setViewVisibility(R.id.linksoben2_2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    }
    else
        this.widgetViews.setViewVisibility(R.id.linksoben2_2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    if(currLevel>=8.333333333333326)
    {
        this.widgetViews.setImageViewResource(R.id.linksoben2_3, 0);
        this.widgetViews.setViewVisibility(R.id.linksoben2_3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    }
    else
        this.widgetViews.setViewVisibility(R.id.linksoben2_3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    if(currLevel>=6.944444444444437)
    {
        this.widgetViews.setImageViewResource(R.id.linksoben2_4, 0);
        this.widgetViews.setViewVisibility(R.id.linksoben2_4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    }
    else
        this.widgetViews.setViewVisibility(R.id.linksoben2_4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    if(currLevel>=5.555555555555548)
    {
        this.widgetViews.setImageViewResource(R.id.obenlinks1, 0);
        this.widgetViews.setViewVisibility(R.id.obenlinks1, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    }
    else
        this.widgetViews.setViewVisibility(R.id.obenlinks1, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    if(currLevel>=4.166666666666659)
    {
        this.widgetViews.setImageViewResource(R.id.obenlinks2, 0);
        this.widgetViews.setViewVisibility(R.id.obenlinks2, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    }
    else
        this.widgetViews.setViewVisibility(R.id.obenlinks2, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);

    if(currLevel>=2.77777777777777)
    {
        this.widgetViews.setImageViewResource(R.id.obenlinks3,0);
        this.widgetViews.setViewVisibility(R.id.obenlinks3, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenlinks3, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    if(currLevel>=1.388888888888881)
    {
        this.widgetViews.setImageViewResource(R.id.obenlinks4, 0);
        this.widgetViews.setViewVisibility(R.id.obenlinks4, View.VISIBLE);
        this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);
    }
    else
        this.widgetViews.setViewVisibility(R.id.obenlinks4, View.INVISIBLE);
    this.widgetViews.setViewVisibility(R.id.oben1, View.INVISIBLE);




    Current_gloalLevel = currLevel;
    float partLevel = currLevel% BATTERY_SCHRITTE;
    Log.d("LOG_TAG","PARTLEVEL: " + partLevel);

    float fullSteps = currLevel-partLevel;
    Log.d("LOG_TAG","FULLSTEPS: " + fullSteps);

    if(partLevel>0) setPartStep((int) ((fullSteps/ BATTERY_SCHRITTE)));
    Log.d("LOG_TAG","currLevel: " + currLevel);
    Log.d("LOG_TAG","BATTERY SCHRITTE: " + BATTERY_SCHRITTE);
    Log.d("LOG_TAG","fullSteps: " + fullSteps);

}


private void setPartStep(int partLevel)

{

    if(partLevel>BATTERY_SCHRITTE){
        this.widgetViews.setImageViewResource(R.id.oben1, 0);
        this.widgetViews.setViewVisibility(R.id.oben1, View.VISIBLE);
    } 
    else
    {
        Log.d("LOG_TAG","Partlevel: " + partLevel);

        switch(partLevel)
        {
        case 1:
            this.widgetViews.setImageViewResource(R.id.oben1, 0);
            this.widgetViews.setViewVisibility(R.id.oben1, View.VISIBLE); 
            break;
        case 2:
            this.widgetViews.setImageViewResource(R.id.oben2, 0);
            this.widgetViews.setViewVisibility(R.id.oben2, View.VISIBLE);
            break;
        case 3:
            this.widgetViews.setImageViewResource(R.id.oben3, 0);
            this.widgetViews.setViewVisibility(R.id.oben3, View.VISIBLE);
            break;
        case 4:
            this.widgetViews.setImageViewResource(R.id.oben4, 0);
            this.widgetViews.setViewVisibility(R.id.oben4, View.VISIBLE);
            break;
        case 5:
            this.widgetViews.setImageViewResource(R.id.obenrechts1, 0);
            this.widgetViews.setViewVisibility(R.id.obenrechts1, View.VISIBLE);
            break;
        case 6:
            this.widgetViews.setImageViewResource(R.id.obenrechts2, 0);
            this.widgetViews.setViewVisibility(R.id.obenrechts2, View.VISIBLE);
            break;
        case 7:
            this.widgetViews.setImageViewResource(R.id.obenrechts3, 0);
            this.widgetViews.setViewVisibility(R.id.obenrechts3, View.VISIBLE);
            break;
        case 8:
            this.widgetViews.setImageViewResource(R.id.obenrechts4, 0);
            this.widgetViews.setViewVisibility(R.id.obenrechts4, View.VISIBLE);
            break;
        case 9:
            this.widgetViews.setImageViewResource(R.id.obenrechts2_1, 0);
            this.widgetViews.setViewVisibility(R.id.obenrechts2_1, View.VISIBLE);
            break;
        case 10:
            this.widgetViews.setImageViewResource(R.id.obenrechts2_2, 0);
            this.widgetViews.setViewVisibility(R.id.obenrechts2_2, View.VISIBLE);
            break;
        case 11:
            this.widgetViews.setImageViewResource(R.id.obenrechts2_3,0);
            this.widgetViews.setViewVisibility(R.id.obenrechts2_3, View.VISIBLE);
            break;
        case 12:
            this.widgetViews.setImageViewResource(R.id.obenrechts2_4,0);
            this.widgetViews.setViewVisibility(R.id.obenrechts2_4, View.VISIBLE);
            break;
        case 13:
            this.widgetViews.setImageViewResource(R.id.obenrechts3_1,0);
            this.widgetViews.setViewVisibility(R.id.obenrechts3_1, View.VISIBLE);
            break;
        case 14:
            this.widgetViews.setImageViewResource(R.id.obenrechts3_2,0);
            this.widgetViews.setViewVisibility(R.id.obenrechts3_2, View.VISIBLE);
            break;
        case 15:
            this.widgetViews.setImageViewResource(R.id.obenrechts3_3,0);
            this.widgetViews.setViewVisibility(R.id.obenrechts3_3, View.VISIBLE);
            break;
        case 16:
            this.widgetViews.setImageViewResource(R.id.obenrechts3_4,0);
            this.widgetViews.setViewVisibility(R.id.obenrechts3_4, View.VISIBLE);
            break;
        case 17:
            this.widgetViews.setImageViewResource(R.id.rechts1,0);
            this.widgetViews.setViewVisibility(R.id.rechts1, View.VISIBLE);
            break;
        case 18:
            this.widgetViews.setImageViewResource(R.id.rechts2,0);
            this.widgetViews.setViewVisibility(R.id.rechts2, View.VISIBLE);
            break;
        case 19:
            this.widgetViews.setImageViewResource(R.id.rechts3,0);
            this.widgetViews.setViewVisibility(R.id.rechts3, View.VISIBLE);
            break;
        case 20:
            this.widgetViews.setImageViewResource(R.id.rechts4,0);
            this.widgetViews.setViewVisibility(R.id.rechts4, View.VISIBLE);
            break;
        case 21:
            this.widgetViews.setImageViewResource(R.id.rechtsunten3_1,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten3_1, View.VISIBLE);
            break;
        case 22:
            this.widgetViews.setImageViewResource(R.id.rechtsunten3_2,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten3_2, View.VISIBLE);
            break;
        case 23:
            this.widgetViews.setImageViewResource(R.id.rechtsunten3_3,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten3_3, View.VISIBLE);
            break;
        case 24:
            this.widgetViews.setImageViewResource(R.id.rechtsunten3_4,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten3_4, View.VISIBLE);
            break;
        case 25:
            this.widgetViews.setImageViewResource(R.id.rechtsunten2_1,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten2_1, View.VISIBLE);
            break;
        case 26:
            this.widgetViews.setImageViewResource(R.id.rechtsunten2_2,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten2_2, View.VISIBLE);
            break;
        case 27:
            this.widgetViews.setImageViewResource(R.id.rechtsunten2_3,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten2_3, View.VISIBLE);
            break;
        case 28:
            this.widgetViews.setImageViewResource(R.id.rechtsunten2_4,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten2_4, View.VISIBLE);
            break;
        case 29:
            this.widgetViews.setImageViewResource(R.id.rechtsunten1_1,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten1_1, View.VISIBLE);
            break;
        case 30:
            this.widgetViews.setImageViewResource(R.id.rechtsunten1_2,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten1_2, View.VISIBLE);
            break;
        case 31:
            this.widgetViews.setImageViewResource(R.id.rechtsunten1_3,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten1_3, View.VISIBLE);
            break;
        case 32:
            this.widgetViews.setImageViewResource(R.id.rechtsunten1_4,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten1_4, View.VISIBLE);
            break;
        case 33:
            this.widgetViews.setImageViewResource(R.id.rechtsunten1,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten1, View.VISIBLE);
            break;
        case 34:
            this.widgetViews.setImageViewResource(R.id.rechtsunten2,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten2, View.VISIBLE);
            break;
        case 35:
            this.widgetViews.setImageViewResource(R.id.rechtsunten3,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten3, View.VISIBLE);
            break;
        case 36:
            this.widgetViews.setImageViewResource(R.id.rechtsunten4,0);
            this.widgetViews.setViewVisibility(R.id.rechtsunten4, View.VISIBLE);
            break;
        case 37:
            this.widgetViews.setImageViewResource(R.id.unten1,0);
            this.widgetViews.setViewVisibility(R.id.unten1, View.VISIBLE);
            break;
        case 38:
            this.widgetViews.setImageViewResource(R.id.unten2,0);
            this.widgetViews.setViewVisibility(R.id.unten2, View.VISIBLE);
            break;
        case 39:
            this.widgetViews.setImageViewResource(R.id.unten3,0);
            this.widgetViews.setViewVisibility(R.id.unten3, View.VISIBLE);
            break;
        case 40:
            this.widgetViews.setImageViewResource(R.id.unten4,0);
            this.widgetViews.setViewVisibility(R.id.unten4, View.VISIBLE);
            break;
        case 41:
            this.widgetViews.setImageViewResource(R.id.untenlinks1,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks1, View.VISIBLE);
            break;
        case 42:
            this.widgetViews.setImageViewResource(R.id.untenlinks2,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks2, View.VISIBLE);
            break;
        case 43:
            this.widgetViews.setImageViewResource(R.id.untenlinks3,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks3, View.VISIBLE);
            break;
        case 44:
            this.widgetViews.setImageViewResource(R.id.untenlinks4,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks4, View.VISIBLE);
            break;
        case 45:
            this.widgetViews.setImageViewResource(R.id.untenlinks1_1,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks1_1, View.VISIBLE);
            break;
        case 46:
            this.widgetViews.setImageViewResource(R.id.untenlinks1_2,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks1_2, View.VISIBLE);
            break;
        case 47:
            this.widgetViews.setImageViewResource(R.id.untenlinks1_3,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks1_3, View.VISIBLE);
            break;
        case 48:
            this.widgetViews.setImageViewResource(R.id.untenlinks1_4,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks1_4, View.VISIBLE);
            break;
        case 49:
            this.widgetViews.setImageViewResource(R.id.untenlinks2_1,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks2_1, View.VISIBLE);
            break;
        case 50:
            this.widgetViews.setImageViewResource(R.id.untenlinks2_2,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks2_2, View.VISIBLE);
            break;
        case 51:
            this.widgetViews.setImageViewResource(R.id.untenlinks2_3,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks2_3, View.VISIBLE);
            break;
        case 52:
            this.widgetViews.setImageViewResource(R.id.untenlinks2_4,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks2_4, View.VISIBLE);
            break;
        case 53:
            this.widgetViews.setImageViewResource(R.id.untenlinks3_1,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks3_1, View.VISIBLE);
            break;
        case 54:
            this.widgetViews.setImageViewResource(R.id.untenlinks3_2,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks3_2, View.VISIBLE);
            break;
        case 55:
            this.widgetViews.setImageViewResource(R.id.untenlinks3_3,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks3_3, View.VISIBLE);
            break;
        case 56:
            this.widgetViews.setImageViewResource(R.id.untenlinks3_4,0);
            this.widgetViews.setViewVisibility(R.id.untenlinks3_4, View.VISIBLE);
            break;
        case 57:
            this.widgetViews.setImageViewResource(R.id.links1,0);
            this.widgetViews.setViewVisibility(R.id.links1, View.VISIBLE);
            break;
        case 58:
            this.widgetViews.setImageViewResource(R.id.links2,0);
            this.widgetViews.setViewVisibility(R.id.links2, View.VISIBLE);
            break;
        case 59:
            this.widgetViews.setImageViewResource(R.id.links3,0);
            this.widgetViews.setViewVisibility(R.id.links3, View.VISIBLE);
            break;
        case 60:
            this.widgetViews.setImageViewResource(R.id.links4,0);
            this.widgetViews.setViewVisibility(R.id.links4, View.VISIBLE);
            break;
        case 61:
            this.widgetViews.setImageViewResource(R.id.linksoben3_1,0);
            this.widgetViews.setViewVisibility(R.id.linksoben3_1, View.VISIBLE);
            break;
        case 62:
            this.widgetViews.setImageViewResource(R.id.linksoben3_2,0);
            this.widgetViews.setViewVisibility(R.id.linksoben3_2, View.VISIBLE);
            break;
        case 63:
            this.widgetViews.setImageViewResource(R.id.linksoben3_3,0);
            this.widgetViews.setViewVisibility(R.id.linksoben3_3, View.VISIBLE);
            break;
        case 64:
            this.widgetViews.setImageViewResource(R.id.linksoben3_4,0);
            this.widgetViews.setViewVisibility(R.id.linksoben3_4, View.VISIBLE);
            break;
        case 65:
            this.widgetViews.setImageViewResource(R.id.linksoben2_1,0);
            this.widgetViews.setViewVisibility(R.id.linksoben2_1, View.VISIBLE);
            break;
        case 66:
            this.widgetViews.setImageViewResource(R.id.linksoben2_2,0);
            this.widgetViews.setViewVisibility(R.id.linksoben2_2, View.VISIBLE);
            break;
        case 67:
            this.widgetViews.setImageViewResource(R.id.linksoben2_3,0);
            this.widgetViews.setViewVisibility(R.id.linksoben2_3, View.VISIBLE);
            break;
        case 68:
            this.widgetViews.setImageViewResource(R.id.linksoben2_4,0);
            this.widgetViews.setViewVisibility(R.id.linksoben2_4, View.VISIBLE);
            break;
        case 69:
            this.widgetViews.setImageViewResource(R.id.obenlinks1,0);
            this.widgetViews.setViewVisibility(R.id.obenlinks1, View.VISIBLE);
            break;
        case 70:
            this.widgetViews.setImageViewResource(R.id.obenlinks2,0);
            this.widgetViews.setViewVisibility(R.id.obenlinks2, View.VISIBLE);
            break;
        case 71:
            this.widgetViews.setImageViewResource(R.id.obenlinks3,0);
            this.widgetViews.setViewVisibility(R.id.obenlinks3, View.VISIBLE);
            break;
        case 72:
            this.widgetViews.setImageViewResource(R.id.obenlinks4,0);
            this.widgetViews.setViewVisibility(R.id.obenlinks4, View.VISIBLE);
            break;
        default:

            }
            break;
        }

    }

Also wie gesagt der Code geht, aber ab api 22 wird nur noch das Grundgerüst vom Widget angezeigt.

Wenn einer weiß was für Änderungen ab Android 5.1 vorgenommen wurden wäre ich ihm sehr dankbar.

Mit freundlichen grüßen

Antworten
Pascal P.
  • Mod
  • Blogger
  • Forum-Beiträge: 10.183

28.05.2016, 13:34:45 via Website

Was heißt "geht nicht"?
Wie genau drückt sich das aus?

Wird das widget angezeigt, bleibt es schwarz/weiss?

Bist du mal mit den debugger durchgegangen, bis wohin der Code funtkioniert?

LG Pascal //It's not a bug, it's a feature. :) ;)

coreytaylor211

Antworten
  • Forum-Beiträge: 9

28.05.2016, 13:40:43 via Website

Hi also der Code läuft durch soweit ich das sehen kann,
alle Logs werden ausgegeben.

Ja Also das Widget an sich kann ich ganz normal auf den sreen ziehen es wird auch angezeigt, aber es ist halt leer.

Normalerweise sollten da ganz viele kleine Lichter (remoteViews ) zu sehen sein.

Antworten
Pascal P.
  • Mod
  • Blogger
  • Forum-Beiträge: 10.183

28.05.2016, 13:52:42 via App

Hmm laut Api änderung auf d.android.com wurde da auf 22 und 23 nichts an den Widget Komponenten/RemoteViews geändert.
Hast du denn zusätzlich mit dem Umstellen der ApiVersion auch alle Libs aktualisiert wie z.b AppCompat oder Supportv4?

— geändert am 28.05.2016, 13:53:03

LG Pascal //It's not a bug, it's a feature. :) ;)

coreytaylor211

Antworten
  • Forum-Beiträge: 9

28.05.2016, 14:23:13 via Website

Ja habe es gerade nochmal überprüft ist alles auf dem neusten Stand. Ich war gerade mal auf der seite d.android .com aber die Seite mit den Unterschieden kann ich nicht finden.
Ich wollte nachschauen was der Unterschied zwischen Api 21 und 22 ist, bei 21 war ja noch alles gut.

Ich dachte auch erst es hat was mit dem Alarmmanager zu tun hier mal ein der Code Teil : alarmM.setRepeating(AlarmManager.RTC_WAKEUP,System.currentTimeMillis() + 1000 * 4, 60000,pendingI);`

Ich habe erfahren das setRepeating nicht mehr genuzt wird, sondern :setExact`

oder ab api 23 : setExactAndAllowWhileIdle`

aber geholfen hat es leider auch nicht.

Antworten
  • Forum-Beiträge: 9

28.05.2016, 20:31:11 via Website

Bin jetzt noch die ganzen Änderungen durchgegangen, es gibt keine Grundlage warum das Widget aufeinmal nicjt mehr geht.

Ich habe das extra nochmal mit Android 5.0 ausprobiert und den Alarmmanager rausgenommen, selbst da wurden die remoteviews noch angezeigt.

Also liegt es zu 99,99% nicht an dem Alarmmanager.
Vielleicht gibt es hier ja im Forum jemanden der so spezial fälle lösen kann....ich hoffe es.

Antworten
Pascal P.
  • Mod
  • Blogger
  • Forum-Beiträge: 10.183

28.05.2016, 21:53:34 via App

Ich weiss leider nichts mehr dazu..

Aber was spricht dagegen, das target etstmal auf Api 21 zu lassen?
Solange du keine Spezialfeatures brauchst sollte das eigentlich auch gehen

LG Pascal //It's not a bug, it's a feature. :) ;)

coreytaylor211

Antworten
  • Forum-Beiträge: 9

28.05.2016, 21:57:38 via Website

Ja das Problem ist, das ich mehrere Freunde habe die Android 5.1 - 6 nutzen daher wäre es sehr schön wenn ich das irgendwie hinbekommen könnte.

Und dazu kommt natürlich noch das mir das keine Ruhe lässt. Ich werde hier total verrückt.

— geändert am 28.05.2016, 21:59:41

Antworten
  • Forum-Beiträge: 9

30.05.2016, 12:50:39 via Website

Hat jemand vielleicht nich eine Idee ? Oder brauch jemand noch mehr Infos ? Ihr müsst mir das sagen wenn etwas unklar ist.

Antworten
Pascal P.
  • Mod
  • Blogger
  • Forum-Beiträge: 10.183

30.05.2016, 14:38:30 via App

Hallo coreytaylor211!

Bitte nicht pushen, gib doch der Community ein wenig Zeit!

Wenn sich jemand findet, der eine Antwort zu deiner Frage weiß, dann wird er/sie es bestimmt hier posten, also hab noch ein wenig Geduld... :?

LG Pascal //It's not a bug, it's a feature. :) ;)

coreytaylor211

Antworten

Empfohlene Artikel