×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    159

    please help,plateformReques not working properly for email in S40

    now I am working for nokia asha501 using asha sdk1.0. i tried to use platforeRequest in my app but when i call platformRequest in midlet class in working properly my code is
    Code:
    protected void startApp() throws MIDletStateChangeException {
    		
    		// TODO Auto-generated method stub
    		Display.init(this);
    		
    		Form form=new Form();
    		Button button=new Button("sms");
    		button.addActionListener(new ActionListener() {
    			
    			public void actionPerformed(ActionEvent arg0) {
    				// TODO Auto-generated method stub
    				try 
    				{
    					
    					platformRequest("mailto:?body=  hi vikrant ........");
    				} catch (ConnectionNotFoundException e)
    				{
    					// TODO Auto-generated catch block
    					e.printStackTrace();
    				} 
    			}
    		});
                  form.show();
    it working well but when use platformrequest in other class it thorw an exception in code is give below
    this is midlet class which extends midlet
    Code:
    protected void startApp() throws MIDletStateChangeException {
    		
    		// TODO Auto-generated method stub
    		Display.init(this);
    		
    		Form form=new Form();
    		
    		
    		on call=new Button("call");
    		call.addActionListener(new ActionListener() {
    			
    			public void actionPerformed(ActionEvent arg0) {
    				// TODO Auto-generated method stub
    				Callpaltform cl=new Callpaltform();
    				cl.platform();
    			}
    		});
    		form.addComponent(call);
    		
    		form.show();
    
    	}
    and my second Callpaltform class is
    Code:
    public class Callpaltform {
    	Form form;
    	MIDlet midlet;
    	
    	public void platform()
    	{
    		
    		
    		Form form=new Form();
    		Button button=new Button("sms");
    		button.addActionListener(new ActionListener() {
    			
    			public void actionPerformed(ActionEvent arg0) {
    				// TODO Auto-generated method stub
    				try 
    				{
    					//platformRequest("sms:+917814986367");
    					midlet.platformRequest("mailto:?body=  hi vikrant ........");
    				} catch (ConnectionNotFoundException e)
    				{
    					// TODO Auto-generated catch block
    					e.printStackTrace();
    				} 
    			}
    		});
    		form.addComponent(button);
    		form.show();
    		
    	}
    
    }
    exception is
    java.lang.NullPointerException
    - Callpaltform$1.actionPerformed(Callpaltform.java:27)
    - com.sun.lwuit.util.EventDispatcher.fireActionSync(EventDispatcher.java:312)
    - com.sun.lwuit.util.EventDispatcher.fireActionEvent(EventDispatcher.java:257)
    - com.sun.lwuit.Button.fireActionEvent(Button.java:366)
    - com.sun.lwuit.Button.released(Button.java:397)
    - com.sun.lwuit.Button.pointerReleased(Button.java:473)
    - com.sun.lwuit.Form.pointerReleased(Form.java:2040)
    - com.sun.lwuit.Component.pointerReleased(Component.java:2065)
    - com.sun.lwuit.Display.handleEvent(Display.java:1635)
    - com.sun.lwuit.Display.edtLoopImpl(Display.java:886)
    - com.sun.lwuit.Display.mainEDTLoop(Display.java:831)
    - com.sun.lwuit.RunnableWrapper.run(RunnableWrapper.java:119)
    - java.lang.Thread.run(), bci=5
    so please tell me how it will work properly
    thanks

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: please help,plateformReques not working properly for email in S40

    Chances are that 'midlet' is null. At least it is not set to anything in the provided code fragments, and null pointers often have a role in null pointer exceptions.

  3. #3
    Registered User
    Join Date
    May 2013
    Posts
    159

    Re: please help,plateformReques not working properly for email in S40

    please tell me where is the problem in my code what should i change in code .can u explain in detail .i sent my complete code so please tell me where is the problem in my code ...

  4. #4
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Re: please help,plateformReques not working properly for email in S40

    Hi

    Check your Call Platform class.You have written
    Code:
    MIDlet midlet;
    But u have not passed a reference to the current MIDlet to it.Get the current MIDlet object using something like MIDlet m = this; in startApp method.Pass that to your Callplatform class and assign the MIDlet reference to "midlet" variable.

  5. #5
    Registered User
    Join Date
    May 2013
    Posts
    159

    Re: please help,plateformReques not working properly for email in S40

    thanks arunkam .now it is working

Similar Threads

  1. please help,plateformReques not working properly for email in S40
    By vikranttanwar@ in forum Mobile Java General
    Replies: 13
    Last Post: 2013-09-02, 13:09
  2. GPS on 5800 v50 still not working properly
    By mastero in forum Series 40 & S60 Platform Feedback Archive
    Replies: 1
    Last Post: 2010-05-06, 13:33
  3. GPS not working properly on n97, n86
    By goosebumps4 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2010-04-30, 21:33
  4. Replies: 2
    Last Post: 2006-09-29, 22:13
  5. Slider Example not working properly on 2.8 SDK
    By d.roettsches in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2005-12-12, 12:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×