When is showNotify() and hideNotify() methods of Canvas class called.

Hi,
I am porting SUN CLDC JVM.
I needed to know when the JVM calls showNotify() and hideNotify() methods of Canvas class of MIDP?
What events need to be sent to JVM for it to call the above methods?

The JSR-118 says: "The change in visibility state of a Canvas may be caused by the application management software moving MIDlets between foreground and background states, or by the system obscuring the Canvas with system screens." This I'd understand that in case of showing list of commands overlaping part of the screen - then no - current screen is still active. In case there is completely different screen with list of commands - then yes - you display different screen.
Rada

Similar Messages

  • On my iPhone 4, people cant hear me when I make and / or receive normal (GSM) phone calls. But when on calls using internet based / native apps like viber or skype, people can hear me just fine. Voice memos work too and have already tried different SIMs

    On my iPhone 4, people cant hear me when I make and / or receive normal (GSM) phone calls. But when I make/receive calls using internet-based / native apps like viber or skype, people can hear me just fine. I have tried recording my voice using voice memos - this works. And have already tried different SIM cards but the problem persists.
    I have taken my phone to an authorized Apple service center, where they restored my phone to factory settings, but still facing the same issue. They service center directed me to Apple Customer Care Hotline, where I have now spent 3+ hours explaining my issue and yet no one can resolve it. The easy answer if to replace the phone - and since it is out of warranty, I am expected to pay for it.
    Additionally, the customer service has been so rude and confrontational that it has completely changed my view of Apple and its customer focus. I am a disappointed and angry customer today - people would be surprised to hear just how rude customer service was including making statements such as "Apple doesnt make infallible products, that's why warranty is needed for our products" and that "every product undergoes a problem at some stage, so do ours!" There goes whatever confidence I had...
    My concern is simple - if no one at Apple and / or its CS hotline is able to address my issue comprhensively and keep telling me that they have never encountered a precedent before, then with what right can they expect me to pay for a replacement?! I am NOT here to fund Apple's research into their product faults and manufacturing.
    And even though a customer is out of warranty, is it too much to expect an Apple product to work well for at least a 'reasonable' period of time. My phone is less than 18 months old and has been facing this issue for the past 2 months - surely the longevity of Apple products is more than 18 months!
    Just a sad sad day for an Apple customer, compounded by unjustifiably rude and aggressive staff. And still no resolution to my problem.

    I am having the same issue - with my last 2 iPhone 4's. My first handset each time I was on a call wether it was up to my ear or on loud speaker, the call would automatically mute even though the mute button wouldn't show up as highlighted. Pressing the mute button on and off during the call doesn't fix it either. I rang Apple and asked what some of their trouble shooting solutions were. I got told that it might be a software issue and to install the latest software update. This failed. I then got told to uninstall the software on the phone and do a complete restore. This also failed. After trying the troubleshooting suggestions, I took the phone into my provider and they sent me out a new phone within a week under warranty claiming it was a hardware issue and probably just a "glitch" with that particular phone. This was not the case....
    After receiving my second iPhone 4, I was hopeful that it would work. For the first couple of days, making/receiving calls was not an issue. Until after about a week, the same problem started again. In one instance I had to hang up and call back 4 times and the call would still automatically mute after about 5 seconds. Also on the second handset, the main camera located on the back of the phone has red and blue lines running through it and can't take a decent picture. So back to the store I go to get another replacement - Again.
    For a phone that is rated highly and as a keen Apple product purchaser, I am a bit disappointed with the experience I have had with the iPhone 4. Let's hope they find a fix sometime soon because this is becoming a bit beyond a joke.....!!

  • SelectAll and setCaretPosition methods in textcomponent class

    One of my project requirement is to highlight the text when it is being typed in a text field. I am trying to do using selectAll method of text component but it sets the caret position to 0. Also if I set the caret position to end of text, the selection of text in the text field is removed.
    Please let me know if there can be any work around for this problem.
    Thanks,

    The method that you used textField.selectAll(); is correct for select
    the text, but each times that you press a key the text highlighted is overwrite.
    I think that you would owe use selectAll() when the textField lost focus. I hope help you and excuse for my english.

  • Write a servlet without doGet() and doPost() methods

    Hi,
    Can we write a servlet without doGet() and doPost() methods ?

    public class MyCoolServlet extends HttpServlet
    public void init(ServletConfig servletConfig) throws ServletException
    public void service(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
    // your code here
    }Just an example on how to do it.
    A servlet is loaded by server (before any request). It will run the init function. Then pick up an request, spawn a thread and put this servlet code into the thread, give it session, request and response objects, then call serivce.
    Remember that init is called before, outside the thread, while service is inside the thread and the last to be called. Nice place to put your code.
    If you need to have some sort of init function to be called first on every request PR USER, then make your own function, and call it first in service method.
    Stuff that are put in init() function might only get runned once in the entire server lifetime. Until restart.

  • Using mutator and accessor methods in main.

    Would somebody explain to me exactly how mutator and accessor methods make a class and it's driver program work together. I understand the principle of encapsulation, but I'm obviously missing something. I get the syntax, but what actually happens? I'm hoping a fresh perspective on it will help me understand better.
    I guess another way to ask the question could be: how do you use accessor and mutator methods in the main program that calls them?

    >
    the assignment says to have a
    "reasonable set of accessor and mutator methods
    whether or not you use them". So in my case I have
    them written in the class but do not call them inthe
    driver program. And like I said, the program does
    what it's supposed to do.This class you're in worries me. I'm sure what
    polytropos said is true: they're trying to make you
    think about reuse. But adding to an API without cause
    is widely considered to be a mistake, and there are
    those who are strongly opposed to accessors/mutators
    (or worse, direct field access) on OOP design grounds.The class is based on the book Java: Introduction to Computer Science and Progamming, by Walter Savitch. Until now I've been pretty happy with it. Another problem, to me anyway, is that so far we've done a few, cumulative programming projects per chapter. This time, there was one assignment for the whole chapter that is suppsoed to incorporate everything. But that's just me complaining.
    Here is the code I have and that it looks like I'll be turning in... criticisms welcome.
    Here is the class:
    public class GradeProgram//open class
         private double quiz1;
         private double quiz2;
         private double mid;
         private double fin;
         private double finalGrade;
         private char letterGrade;
         public void readInput()//open readInput object
              do
                   System.out.println("Enter the total points for quiz one.");
                   quiz1 = SavitchIn.readLineInt();
                   System.out.println("Enter the total points for quiz two.");
                   quiz2 = SavitchIn.readLineInt();
                   System.out.println("Enter the mid term score.");
                   mid = SavitchIn.readLineInt();
                   System.out.println("Enter final exam score.");
                   fin = SavitchIn.readLineInt();
                   if ((quiz1>10)||(quiz2>10)||(quiz1<0)||(quiz2<0))
                   System.out.println("Quiz scores are between one and ten.  Re-enter scores");
                   if ((mid>100)||(fin>100)||(mid<0)||(fin<0))
                   System.out.println("Exam scores are between zero and one hundred.  Re-enter scores.");
              while ((quiz1>10)||(quiz2>10)||(quiz1<0)||(quiz2<0)||(mid>100)||(fin>100)||(mid<0)||(fin<0));
         }//end readInput object
         public void output()//open output object
              System.out.println();
              System.out.println("You entered:");
              System.out.println("Quiz 1: " + (int)quiz1);
              System.out.println("Quiz 2: " + (int)quiz2);
              System.out.println("Mid term: " + (int)mid);
              System.out.println("Final exam: " + (int)fin);
              System.out.println();
              System.out.println("Final grade: " + (int)percent() + "%");
              System.out.println("Letter grade: " + letterGrade());
         }//end output object
         public void set(double newQuiz1, double newQuiz2, double newMid, double newFin, double newFinalGrade, char newLetterGrade)
              if ((newQuiz1 >= 0)&&(newQuiz1 <= 10))
              quiz1 = newQuiz1;
              else
                   System.out.println("Error: quiz scores are between zero and ten.");
                   System.exit(0);
              if ((newQuiz2 >= 0)&&(newQuiz2 <= 10))
              quiz2 = newQuiz2;
              else
                   System.out.println("Error: quiz scores are between zero and ten.");
                   System.exit(0);
              if ((newMid >= 0)&&(newMid <= 100))
              mid = newMid;
              else
                   System.out.println("Error: exam scores are between zero and one hundred.");
                   System.exit(0);
              if ((newFin >= 0)&&(newFin <= 100))
              fin = newFin;
              else
                   System.out.println("Error: exam scores are between zero and one hundred.");
                   System.exit(0);
              letterGrade = newLetterGrade;
         public double getQuiz1()
              return quiz1;
         public double getQuiz2()
              return quiz2;
         public double getMid()
              return mid;
         public double getFin()
              return fin;
         public char getLetterGrade()
              return letterGrade;
         private double finalPercent()//open finalPercent object
              double quizPercent = (((quiz1 + quiz2) /2) * 10) / 4;
              if (((((quiz1 + quiz2) /2) * 10) % 4) >= 5)
                   quizPercent++;
              double midPercent = mid / 4;
              if ((mid % 4) >= 5)
                   midPercent++;
              double finPercent = fin / 2;
              if ((fin % 2) >= 5)
                   finPercent++;
              finalGrade = (quizPercent + midPercent + finPercent);
              return (finalGrade);
         }//end final percent object
         private double percent()//open percent object - helping object
              double percentGrade = finalPercent();
              return (percentGrade);
         }//end percent object
         private char letterGrade()//open letterGrade object
              double letter = percent();
              if (letter >= 90)
                   return ('A');
              else if (letter >= 80)
                   return ('B');
              else if (letter >= 70)
                   return ('C');
              else if (letter >= 60)
                   return ('D');
              else
                   return ('F');
         }//end letterGrade object
         private double quizScore()//open quizScore object
              double quizes = ((quiz1 + quiz2) /2) * 10;
              return (quizes);
         }// close quizScore object
    }//end classAnd here is the driver program:
    public class GradeProgramDemo
         public static void main(String[] args)
              String cont;
              do
                   GradeProgram firstStudent = new GradeProgram();
                   firstStudent.readInput();
                   firstStudent.output();
                   System.out.println();
                   System.out.println("Enter more student grades?  Enter Y to continue");
                   System.out.println("or press enter to quit.");
                   cont = SavitchIn.readLine();
                   System.out.println();
              while (cont.equalsIgnoreCase("y"));

  • Comparing dynamic fields of objects using equals and hashCode methods

    To compare the different objects of the same class with their contents like jobTitleId, classificationId, deptId & classificationId was to be done and do some manipulations later using Set and Map. I was able to do that by simply overriding the equals and hashCode methods of Object class and was able to fetch the information (like in the following Map).
        Map<LocationData, List<LocationData>>
    The following is the class I used (its been shown to you so that it can be referred for my problem statement):
    LocationData class
        package com.astreait.bulkloader;
        public class LocationData {    
            String locId, deptId, jobTitleId, classificationId;
            @Override  
            public boolean equals(Object obj) {        
                LocationData ld = (LocationData)obj;       
                return this.deptId.equals(ld.deptId) && this.jobTitleId.equals(ld.jobTitleId) && this.classificationId.equals(ld.classificationId) &&
        this.locId.equals(ld.locId);   
            @Override  
            public int hashCode() {        
                return deptId.hashCode() + jobTitleId.hashCode() + classificationId.hashCode() +locId.hashCode();  
    Problem:
    I'm already known to which all fields of this object I need to make the comparison.
    i.e I'm bound to use the variables named classificationId, deptId, jobTitleId & locId etc.
    Need:
    I need to customize this logic such that the fields Names (classificationId, deptId, jobTitleId & locId etc) can be pulled dynamically along with their values. So, as far as my understanding I made use of 2 classes (TableClass and ColWithData) such that the List of ColWithData is there in TableClass object.
    I'm thinking what if I override the same two methods `equals() & hashCode();`
    such that the same can be achieved.
        TableClass class #1
        class TableClass{
            List<ColWithData> cwdList;
            @Override
            public boolean equals(Object obj) {
                boolean returnVal = false;
                        // I need to have the logic to be defined such that
                        // all of the dynamic fields can be compared
                return returnVal;
            @Override
            public int hashCode() {
                int returnVal = 0;
                        // I need to have the logic to be defined such that
                        // all of the dynamic fields can be found for their individual hashCodes
                return returnVal;
    ColWithData class #2
        class ColWithData{
            String col; // here the jobTitleId, classificationId, deptId, locId or any other more fields info can come.
            String data; // The corresponding data or value for each jobTitleId, classificationId, deptId, locId or any other more fields.
    Please let me know if I'm proceeding in the right direction or I should make some any other approach. If it is ok to use the current approach then what should be performed in the equals and hashCode methods?
    Finally I need to make the map as: (Its not the concern how I will make, but can be considered as my desired result from this logic)
        Map<TableClass, List<TableClass>> finalMap;

    Hello,
    What is the relation with the Oracle Forms tool ?
    Francois

  • Problems calling a method in another class

    I have the following method in a class called recordCalls -
    public static void objectCreated(String type, String name)
            System.out.println("An object of type " + type + " called " + name + " has been created.");
    //       addObjectToPanel(type, name);  
        }I am attempting to call addObjectToPanel(type, name) which is a method inside a class called test.
    I do not want to create an instance of test an call it like test.addObjectToPanel(type, name)
    Is there any other way of doing this.
    Thanks.

    You either have to make the method static, and call
    test.addObjectToPanel or you have to create an
    instance of test and invoke the method on that
    instance.
    I don't know what that class is supposed to do, so I
    don't know which is more appropriate.
    You should name your classes starting with capital
    letters, and Test is a very undescriptive (and hence
    bad) name for that class.I will be chaning the names of everything when the class works.
    Test contains the UI for my program.
    When I run test then my UI is runing, once I run addObjectToPanel from the record calls class it should put images into my UI,
    the problem is that each time the method is run it open up a different UI and adds an image to it instead of just adding the images to the window which is already open.

  • Invoking the main() method of a class within another

    Greetings -
    Can someone tell me what happens when you invoke the main() method of a class from within another class?
    I have a third-party class, designed to be invoked from a command line, that I want to invoke from within a separate class. What appears to be happening is that following the successful execution of the third-party class, the invoking class is terminated as well. That's not the intended behavior I had envisioned. ^_^
    Is there a better way than invoking the main() method? I still need the invoking class to continue executing.
    Thanks!

    Navigate yourself around pitfalls related to the Runtime.exec() method

  • Implementing UIApplicationDelegate protocol methods in NSObject class not working.

    Hi Everyone,
    I am new bee in iphone developement. I want to implement UIApplicationDelegate protocol methods in one of my NSObject class, how can i implement that help me please.
    I have mentioned the sample code what acutal i want to impelment.
    .h file
    @interface SmaplClass : NSObject <UIApplicationDelegate>
    .m file
    - (void)applicationWillResignActive:(UIApplication *)application
    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
    -(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
    - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
    Want to implement the above methods is NSObject class to be implemented or used, its not working. Help me can do it.
    Please help me
    Thanks,

    I complete the above discussion with saying that it is better to implement the notification handling methods in your app delegate. If there are good reasons to not to do so, you have to implement the methods in another class, instantiate the class, and call the methods from the actual UIApplicationDelegate protocol methods in the AppDelegate object. This way you can remove the actual notification handling code from AppDelegate class.
    For example, suppose you implemented the methods in the class called Test. This is a sample code in the AppDelegate class:
    @implementation AppDelegate
    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
          Test *t = [[Test alloc] init];
         [t application: application didReceiveRemoteNotification: userInfo];
    @end
    Or you can create an association relationship between the AppDelegate and Test, so you do not have to create a new Test instance in each of the remote notification handling methods:
    @interface AppDelegate {
         Test *test;
    @end
    @implementation AppDelegate
    + (id)init {
         if (self = [super init]) {
              test = [[Test alloc] init];
         return self;
    - (void)dealloc {
         [test release];
         [super dealloc];
    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
         // No need to create a Test instance. You just forward the call from AppDelegate instance to test      // instance
         [test application: application didReceiveRemoteNotification: userInfo];
    @end

  • Problem refreshing canvas when multiple windows and canvasses.

    Ok I Have a form that has 2 windows and 2 canvases.
    They both get populated on When new Forms instance trigger with a parameter i pass in from teh previous form.
    On entering the form if the parameter is set (passed in by the form before) it should query the blocks on canvas 1 and display the second canvas/window via a seperate package of "canvas.open" which is a package to open and populate the second canvas which is a tree.
    If this code is fired on a key next item or a button press its fine. but not where it is on when new form instance trigger. The canvas.open simply stops on a synchronize early on. If i remove a sync then the second canvas never appears.
    You can see a commented out pause. If this is included then it all works fine. If i use a synchronize instead of the pause it doesnt even reach the canvas.open (i used messages on status to work this out)
    So my question is how can i get a synchronize to work as i assume this is whats missing?
    Any help much appreciated, Im sorry if i have not explained very well.
    IF :PARAMETER.I IS NOT NULL THEN                    
                   Go_Block('B1');               
                   Execute_Query(no_validate);
                   Go_Block('B2');
                   Execute_Query(no_validate);
    --PAUSE;
                   canvas.Open(:PARAMETER.I);                    
    END IF;          

    What happens if you do a
    IF :PARAMETER.I IS NOT NULL THEN                    
                   Go_Block('B1');               
                   Execute_Query(no_validate);
    SYNCHRONIZE;
                   Go_Block('B2');
                   Execute_Query(no_validate);
    SYNCHRONIZE;
                   canvas.Open(:PARAMETER.I);                    
    END IF;

  • I just got the Itunes update. So frustrating. I will be trying methods on this forum to save my library and re-install the older version of ITunes. What was Apple thinking when they developed and released this mess?

    I just got the Itunes update. So frustrating. I will be trying methods on this forum to save my library and re-install the older version of ITunes. What was Apple thinking when they developed and released this mess?

    Apple is more likely to see your comments if you send feedback via:
    http://www.apple.com/feedback/itunesapp.html
    =Downgrading from iTunes 11 to iTunes 10.7=
    You may be able to go back with Time Machine but this may involve restoring other items too (https://discussions.apple.com/message/20441404).  Alternatively:
    Back up your computer first, in case the unexpected happens.
    Quit iTunes.
    Get iTunes 10.7 from http://support.apple.com/kb/DL1576 or the direct download link at:  http://appldnld.apple.com/iTunes10/041-7195.20120912.d3uzQ/iTunes10.7.dmg
    Do a few preparatory steps by making sure all iTunes components are not running and cleaning old files.   See https://discussions.apple.com/message/20475394.  Do steps 3 and 4.  Steps 6-8 may be also useful but I don't know if they are essential.  Some of the other steps are not necessary, duplicate steps listed later in my post or are perhaps even unhelpful in the process.
    Replace the iTunes 11 application with iTunes 10.7.  Simply dragging the application to the trash may not work. Lion (OSX 10.7) and newer systems have iTunes integrated into the operating system and deleting is a bit more involved.  Two ways to do this are:
    1.  Use the shareware Pacifist utility (http://www.charlessoft.com/) to install iTunes 10.7 including all associated system files. Details at http://forums.macrumors.com/showpost.php?p=16400819&postcount=6
    2. Check this reference on how to delete the iTunes application itself:
        Delete iTunes in Mac OS X 10.7 Lion - http://osxdaily.com/2011/09/13/delete-itunes-in-mac-os-x-10-7-lion/
        After deleting the application there may be other files that need downgrading too. See the note about error -42408 at the end of this post. You may want to tuck these away somewhere safe until you have completed the installation of iTunes 10.7.  I have not tested this but ideally if newer versions are not found then the installer will put in the old versions. This may include these files in /System/Library/PrivateFrameworks/ which apparently get updated by iTunes 11:
    AirTrafficHost.framework
    CoreFP.framework
    DeviceLink.framework
    iTunesAccess.framework
    MobileDevice.framework
    After doing one of the two procedures above you will have to rescue the most recent old iTunes library from your iTunes > Previous Libraries folder. Rename it "iTunes Library.itl"  and replace the existing one in the iTunes folder. A newer version of iTunes irreversibly updates your library file so you have to replace it with the old one or you will get an error message. Note, this will revert your library to the version at the time of the upgrade and you will have to update any changes made since.  See:
    https://discussions.apple.com/message/20401436 - turingtest2 11/2012 post on rebuilding empty/corrupt library from previous iTunes library file after upgrade/crash.
    iTunes: How to re-create your iTunes library and playlists - http://support.apple.com/kb/ht1451
    Other issues:
    - https://discussions.apple.com/message/20432309 - solution to mobile devices saying they need to be restored after downgrading
    - If you encounter error -42408:
    iTunes: Advanced iTunes Store troubleshooting - http://support.apple.com/kb/TS3297 > Specific Conditions and Alert Messages: (Mac OS X / Windows) - including specific error codes.
    Alternatively, check https://discussions.apple.com/message/20441424 which requires you have a Time Machine backup (though possibly if you remove the newer version of these files old ones may be installed with the iTunes 10.7 installer - untested).  A  variant of this is at: https://discussions.apple.com/message/20448184
    - Persistent "Show in iTunes Store" arrows after downgrade - https://discussions.apple.com/thread/4567064

  • When dragging an image onto a fresh canvas, the resizing feature presnaps the image into the canvas size. I can confirm that this has not happened to me in previous projects. I've also tested this problem by making a new larger document size and dragging

    Contexts: I am very competent with GFX and have worked on many projects.
    When dragging an image onto a fresh canvas, the resizing feature presnaps the image into the canvas size. I can confirm that this has not happened to me in previous projects. I've also tested this problem by making a new larger document size and dragging in the same render. It snaps again. I don't want to re-size from the canvas dimensions, I want to resize from the render's original dimensions.

    Ap_Compsci_student_13 wrote:
    ok sorry but doesn't sscce say to post the whole code?the first S is Short, and yes, it needs to be all the code needed to illustrate the problem and let use reproduce it. If you were developing a new Web framework, your example might be short, but for a student game it's very long.

  • When I try and purchas an app with my debit card,it says "select another payment method". What do I do?

    When I try and purchas an app with my debit card,it says "select another payment method". What do I do?

    "You may be able to use other payment types in your country, like debit and Maestro cards. Too see all accepted payment methods, follow these steps:"
    So they are still accepted in some areas

  • When using Final Cut Express, the video in the Viewer window looks fine, but when I insert the video into the Canvas Timeline it appears to lose resolution, and look fuzzy and blurry. Are there preferences or settings for the Timeline that cause this?

    When using Final Cut Express, the video in the Viewer window looks fine, but when I insert the video into the Canvas Timeline it appears to lose resolution, and look fuzzy and blurry. Are there preferences or settings for the Timeline that cause this?

    Thanks David. I had to convert the mts file to Quick Time (using AunSoft Conversion software) before I could import it into Final Cut Express. And I made sure I kept the size of movie (720 X 480 with letterbox) to compliment what I set my Panaconic AVCCAM video recorder at (720/60). Even after I fully render it, it still looks fuzzy in the Canvas window at the right that plays what I have editing down in the Timeline. A friend that edits some using Final Cut Pro helped me to narrow things down to this problem. This is also wierd. If my Viewer window at the left is set to 200% to get the person's head the same size in the Canvas window at the right we needed to put it to 400%. Does this make any sense. We think we need to control the Time line resolution somehow but cannot find any options from my manual, or the help, or in the various drop down menus. Do you have any clue? What is going on?

  • When we override Hashcode and Equal Methods

    Hi....I have doubt regading Hashcode and equal methods
    why we override this two methods....
    why we override hashcode method when we are overriding equal method,
    i would very thankful to give answser
    Thank you
    Ramesh

    hash code is computed to check the equality of two
    objects ,
    that is why if u change the default equal method
    implementation , u need to change the hashcode method
    as well.That's an incomplete answer at best.
    The hashcode method is used by hashing algorithms and data strcutures such as HashMap. This value is used to determine what 'bucket' the reference will go into. It cannot, by itself determine equality.
    If you are still unsure, I suggest looking up 'hash table' on google. I'm sure there's a decent explanation on wikipedia.

Maybe you are looking for