我有一个带有两个内部页面的html(data-role ="page").其中一个页面显示与此日期相关的日期和数据.当我向左或向右滑动时,应该改变.
我需要的是让页面转换显示.好像我不能$.mobile.changePage()用于同一页面.最终我不想刷新页面,因为我必须保留一些全局变量.
有什么建议我怎么能做到这一点?
编辑:在这里找到解决方案.使用这行代码:
$.mobile.changePage( "#reused-page", { allowSamePageTransition: true } );
Run Code Online (Sandbox Code Playgroud) 我正在使用PhoneBap的StatusBarNotification插件(Android)来发送通知.现在我想在特定的时间到这个,从我读过的,我必须使用Android的AlarmManager.我已经尝试了一些方法,但似乎无法让它工作.
有关如何做到这一点的任何建议?
编辑:我可以得到通知,以显示我是否将代码放在onReceive()中showNotification().问题似乎是接收器没有收到Alarm-thingy.可能是因为我在IntentFilter中没有正确的操作.
这是我的代码.我从Phonegap的StatusBarNotification插件构建它,在这里找到
public class StatusBarNotification extends Plugin {
// Action to execute
public static final String ACTION="notify";
private Context context;
BroadcastReceiver receiver;
public StatusBarNotification() {
this.receiver = null;
}
public void setContext(PhonegapActivity ctx) {
super.setContext(ctx);
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(); //Dunno what to put here
if(receiver == null) {
this.receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Log.d("Notification", "inside onReceive");
/*int icon = R.drawable.notification;
long when = System.currentTimeMillis();
NotificationManager manager …Run Code Online (Sandbox Code Playgroud)