我使用xml(使用Microsoft Office的自定义UI编辑器)在功能区中添加了一个复选框.该exec vba代码.即使我关闭应用程序,我也需要此复选框来维护值(已选中或未选中).现在,当我关闭并打开它时,checkBox似乎总是未选中.
我还需要知道是否可以使用vba来确认是否选中了此复选框
我试着在这个论坛找到这个,我发现了一对,但没有人为我工作.我只需要将它隐藏在大图标旁边的通知面板中,但是如果我隐藏它,它也会从通知栏中消失.
有没有办法只显示第一个和第四个通知中发生的大图标?
这是我正在使用的代码:
mNotificationManager = (NotificationManager)
this.getSystemService(Context.NOTIFICATION_SERVICE);
Intent intent;
Notification.Builder mBuilder =
new Notification.Builder(this)
.setSmallIcon(R.mipmap.small_icon).setTicker(getApplicationContext().getResources().getString(R.string.app_name))
.setLargeIcon(largeIcon)
.setAutoCancel(true)
.setVibrate(new long[]{1000, 1000, 1000, 1000, 1000})
.setLights(Color.GREEN, 1000, 1000)
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setContentTitle(extras.getString("title"))
.setStyle(new Notification.BigTextStyle().bigText(extras.getString("message")))
.setContentText(extras.getString("message"));
edit.putString(Config.FRAGMENT, extras.getString("fragment"));
edit.commit();
intent = new Intent(this, NavigationActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
intent, 0);
mBuilder.setContentIntent(contentIntent);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
Run Code Online (Sandbox Code Playgroud) 我正在尝试从文件夹中获取图像以检查其宽度。为此,我使用以下代码:
Dim pic As IPictureDisp
Dim var As Variant
var = "C:\Myfolder\Animage" & animationNum + 1 & ".png"
pic = LoadPicture(var)
Run Code Online (Sandbox Code Playgroud)
它给我“无效图片”错误。我也尝试只使用以下行:
width = LoadPicture("C:\Myfolder\Animage" & animationNum + 1 & ".png").width
Run Code Online (Sandbox Code Playgroud)
但它也给了我同样的错误。我怎样才能加载图片?
编辑
我尝试使用 jpg 图像,它可以工作...此功能对 png 文件是否存在一些问题?
我得到Method myLooper in android.os.Looper not mocked的错误,当我尝试测试我的ViewModel在科特林使用corountines。
有 ViewModel
class MainViewModel(private val uiContext: CoroutineContext = Dispatchers.Main) : ViewModel(), CoroutineScope {
private val heroesRepository: HeroesRepository = heroesRepositoryModel.instance()
val data = MutableLiveData<List<Heroes.Hero>>()
private var job: Job = Job()
override val coroutineContext: CoroutineContext
get() = uiContext + job
fun getHeroesFromRepository(page: Int) {
launch {
try {
val response = withContext(Dispatchers.IO) {
heroesRepository.getHeroes(page).await()
}
data.value = response.data.results
} catch (e: HttpException) {
data.value = null
} catch (e: Throwable) {
data.value = null …Run Code Online (Sandbox Code Playgroud)