11-08-2012 02:32 AM
Hai ,
I am trying to pass BBMPlatformContext in UIapplication to the mainScreen class .. but it shows error ("Null pointer exception"). anyone have solution for this problem .. please help me..
Thanks
Deepu George Jacob
11-08-2012 03:05 AM
This is my sample code
public MyBBMPlatformApp()
{
myplugin = new MyBBMAppPlugin();
invokeLater(new Runnable()
{
public void run()
{
try
{
platformContext = BBMPlatformManager.register(myplugin);
}
catch(Exception e)
{
}
MyBBMPlatformContextListener platformContextListener;
platformContextListener = new MyBBMPlatformContextListener();
platformContext.setListener(platformContextListene
}
});
pushScreen(new MyBBMPlatformScreen(platformContext));
}
11-08-2012 04:26 AM
Look hard at your code and try to figure out the order in which things are processed.
When does the connection to the BBM get established? When is the constructor for your Screen run? What does invokeLater mean?
If this doesn't help, put System.out.println messages in and debug your app.
I suggest that you initiate the BBM connection from your MainScreen. So move the connection code to your MainScreen and then it will have access to the context.
Hope this makes sense?
11-08-2012 05:28 AM
I followed this documentation to implementing BBM please chek it..
Thanks
Deepu
11-08-2012 08:12 AM
That code is correct, but it does not try to pass the context in to the Screen does it?
Like I said, think about how the various steps you have will be processed, I have given you some questions to help with this thought process. If that doesn't do it, debug.
As a clue, the instructions are NOT all processed in the order written.
11-08-2012 11:11 PM
hai,
I am established connection within the mainscreen ... now its works fine....thankyou for you help peter
Deepu
11-09-2012 01:07 AM
I cant register platform context outside the run method
11-09-2012 04:31 AM
Glad you got the method working in the MainScreen. More importantly, I hope you understand why the change made it work. There is a lot of similar asynchronous processing involved in BBM.
Not clear what your last post is all about.
Just to clarify, you should not attempt o establish a connection in other circumstances, for example you should not try to establish connection as part of the main90 or the Screens constructor. The connect has to be run on an independent Thread with access to the UI. .
Can you explain the circumstances of your problem and why you are trying to establish this connection outside the run method?