android.appwidget.AppWidgetHost.startListening()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中android.appwidget.AppWidgetHost.startListening()方法的一些代码示例,展示了AppWidgetHost.startListening()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppWidgetHost.startListening()方法的具体详情如下:
包路径:android.appwidget.AppWidgetHost
类名称:AppWidgetHost
方法名:startListening

AppWidgetHost.startListening介绍

暂无

代码示例

代码示例来源:origin: Neamar/KISS

void onStart() {
  // Start listening for widget update
  mAppWidgetHost.startListening();
}

代码示例来源:origin: WeAreFairphone/FP2-Launcher

@Override
public void startListening() {
  try {
    super.startListening();
  } catch (Exception e) {
    if (!(e.getCause() instanceof TransactionTooLargeException)) {
      // We're willing to let this slide. The exception is being caused by the list of
      // RemoteViews which is being passed back. The startListening relationship will
      // have been established by this point, and we will end up populating the
      // widgets upon bind anyway. See issue 14255011 for more context.
      throw new RuntimeException(e);
    }
  }
}

代码示例来源:origin: fookwood/Launcher3

@Override
public void startListening() {
  try {
    super.startListening();
  } catch (Exception e) {
    if (e.getCause() instanceof TransactionTooLargeException) {
      // We're willing to let this slide. The exception is being caused by the list of
      // RemoteViews which is being passed back. The startListening relationship will
      // have been established by this point, and we will end up populating the
      // widgets upon bind anyway. See issue 14255011 for more context.
    } else {
      throw new RuntimeException(e);
    }
  }
}

代码示例来源:origin: klinker24/Android-Blur-Launcher

@Override
public void startListening() {
  try {
    super.startListening();
  } catch (Exception e) {
    if (e.getCause() instanceof TransactionTooLargeException ||
        e.getCause() instanceof DeadObjectException) {
      // We're willing to let this slide. The exception is being caused by the list of
      // RemoteViews which is being passed back. The startListening relationship will
      // have been established by this point, and we will end up populating the
      // widgets upon bind anyway. See issue 14255011 for more context.
    } else {
      throw new RuntimeException(e);
    }
  }
}

代码示例来源:origin: klinker24/launcher3

@Override
public void startListening() {
  try {
    super.startListening();
  } catch (Exception e) {
    if (e.getCause() instanceof TransactionTooLargeException ||
        e.getCause() instanceof DeadObjectException) {
      // We're willing to let this slide. The exception is being caused by the list of
      // RemoteViews which is being passed back. The startListening relationship will
      // have been established by this point, and we will end up populating the
      // widgets upon bind anyway. See issue 14255011 for more context.
    } else {
      throw new RuntimeException(e);
    }
  }
}

代码示例来源:origin: enricocid/LaunchEnr

@Override
public void startListening() {
  try {
    super.startListening();
  } catch (Exception e) {
    if (!Utilities.isBinderSizeError(e)) {
      throw new RuntimeException(e);
    }
    // We're willing to let this slide. The exception is being caused by the list of
    // RemoteViews which is being passed back. The startListening relationship will
    // have been established by this point, and we will end up populating the
    // widgets upon bind anyway. See issue 14255011 for more context.
  }
}

代码示例来源:origin: MoMoWait/LeanbackLauncher

protected void onStart() {
  super.onStart();
  Log.i(TAG, "onStart");
  this.mResetAfterIdleEnabled = false;
  if (this.mAppWidgetHost != null) {
    this.mAppWidgetHost.startListening();
  }
  //setShyMode(!isBackgroundVisibleBehind(), true);
  this.mWallpaper.resetBackground();
  /*if (this.mHomeAdapter != null) {
    this.mHomeAdapter.refreshAdapterData();
  }*/
  if (this.mKeepUiReset) {
    resetLauncherState(false);
  }
  if (!this.mStartingEditMode) {
    if (!this.mLaunchAnimation.isInitialized()) {
      this.mLaunchAnimation.init(new LauncherReturnAnimator(this.mList, this.mLaunchAnimation.lastKnownEpicenter, this.mHomeAdapter.getRowHeaders(), this.mHomeScreenView), this.mRefreshHomeAdapter, (byte) 32);
    }
    this.mLaunchAnimation.schedule();
  }
  this.mStartingEditMode = false;
 /*  if (this.mGoogleApiClient != null) {
    this.mGoogleApiClient.connect();
  }*/
}

代码示例来源:origin: rockon999/LeanbackLauncher

protected void onStart() {
  boolean z = true;
  AppTrace.beginSection("onStart");
  try {
    super.onStart();
    this.mResetAfterIdleEnabled = false;
    if (this.mAppWidgetHost != null) {
      this.mAppWidgetHost.startListening();
    }
    //if (isBackgroundVisibleBehind()) {
    //    z = false;
    //}
    setShyMode(z, true);
    this.mWallpaper.resetBackground();
    this.mHomeAdapter.refreshAdapterData();
    if (this.mKeepUiReset) {
      resetLauncherState(false);
    }
    if (!this.mStartingEditMode) {
      if (!this.mLaunchAnimation.isInitialized()) {
        this.mLaunchAnimation.init(new LauncherReturnAnimator(this.mList, this.mLaunchAnimation.lastKnownEpicenter, this.mHomeAdapter.getRowHeaders(), this.mHomeScreenView), this.mRefreshHomeAdapter, (byte) 32);
      }
      this.mLaunchAnimation.schedule();
    }
    this.mStartingEditMode = false;
    AppTrace.endSection();
  } catch (Throwable th) {
    AppTrace.endSection();
  }
}

代码示例来源:origin: clemensbartz/essential-launcher

appWidgetManager = AppWidgetManager.getInstance(this);
appWidgetHost = new AppWidgetHost(this, R.id.frWidget);
appWidgetHost.startListening();

相关文章