English 中文(简体)
如何协调基类
原标题:how to synchronize base class
  • 时间:2010-07-15 09:10:31
  •  标签:
  • blackberry

i have extend a uiapplication for user interface,in which i will take a date on which i schedule a task. and i extend another base class application for running background process which will check the date and execute desired operation. but these both are base class so i want to synchronize them.. and don t know how to synchronize base class.. plz help mee..

最佳回答

首先,我知道这是一个罚款点,但方案拟定工作都涉及罚款点,你没有在班级上同步,你在 Objects(即班级)。

关于黑莓,你可以使用标准的Java同步方法:

public synchronized void mySynchronizedMethod() {
   // synchronized code
}

并同步:

public void myMethod() {
   //code
   syncrhonized(someObject) {
      // synchronized code
   }
   // code
}

您也可以使用特定物体,与活动同步进行,并由您的代码在活动线上操作,从而允许序列化地查阅国际统一分类:

public void myMethod() {
   //code
   syncrhonized(UiApplication.getEventLock()) {
      // synchronized code
   }
   // code
}
问题回答

暂无回答




相关问题
How does AlertListener work on Blackberry API 5.0?

Does the AlertListener interface works globally on all alerts on the blackberry device, or does it only work with alerts generated by your application? In other words, can I use this interface to ...

How to buffer audio in Blackberry?

I need to learn how to buffer audio stream from a remote server in Blackberry. There is a sample buffered playback app with Blackberry api but can you tell what url may I use to test the application?

Blackberry push notification implementation

How does one implement a push notification for a blackberry app? I heard that in order to do so I need to purchase a Blackberry Enterprise Server which costs me 1400 per year. Is this true? Where is ...

热门标签