Question about UiApplication.getUiapplicatin ().
Hi all,.
Hope everything goes well. In fact, I want to ask UiApplication.getUiApplication () gives you your application instance (please, correct me if I'm wrong). Let's look at the code
public class SimpleSmsChatApp extends UiApplication { // Constructor public SimpleSmsChatApp() { //Create the main screen and push it on to the display stack SimpleSmsChatMainScreen mainScreen = new SimpleSmsChatMainScreen(chatScreen, createProfileScreen); pushScreen(mainScreen); } //end of constructor public static void main(String[] args) { //Create an instance of the application SimpleSmsChatApp app = new SimpleSmsChatApp(); // Start the event displatch thread app.enterEventDispatcher(); } // end of main() } //end of class SimpleSmsChatApp
It is a main class simple code. Now suppose I have add a method in this class as follows
public class SimpleSmsChatApp extends UiApplication { private CreateProfileScreen createProfileScreen; private ChatScreen chatScreen; // Constructor public SimpleSmsChatApp() { //Create the main screen and push it on to the display stack SimpleSmsChatMainScreen mainScreen = new SimpleSmsChatMainScreen(chatScreen, createProfileScreen); pushScreen(mainScreen); } //end of constructor public static void main(String[] args) { //Create an instance of the application SimpleSmsChatApp app = new SimpleSmsChatApp(); // Start the event displatch thread app.enterEventDispatcher(); } // end of main() public ChatScreen getChatScreen() { if (chatScreen == null) { chatScreen = new ChatScreen(); } return chatScreen; } //end of getChatScreen() public CreateProfileScreen getCreateProfileScreen() { if (createProfileScreen == null) { createProfileScreen = new CreateProfileScreen(); } return createProfileScreen; } //end of getChatScreen() } //end of class SimpleSmsChatApp
Now I have another class in which I have pimples. Suppose that on the button clicks I want to createProfileScreen and window shows. I have code like this
if (field == searchButton) { CreateProfileScreen createProfileScreen = UiApplication.getUiApplication().getCreateProfileScreen(); UiApplication.getUiApplication().pushScreen(createProfileScreen); } if (field == chatButton) { ChatScreen chatScreen = UiApplication.getUiApplication().getChatScreen(); UiApplication.getUiApplication().pushScreen(chatScreen); }
My question is that
UiApplication.getUiApplication()
gives you the instance of the same instance I created in my main class i.e. SimpleSmsChatApp. But it gives me the error that cannot find symbol getChatScreen().
I want to ask that whe
UiApplication.getUiApplication(
give me the instance of the main class (SimpleSmsChatApp) and I have getChatScreen() and getCreateProfileScreen() in my main class so why it gives me error that cannot find symbol.
I'm doing this because I want any number of screens I have in my project, I created each instance of the form only once and then call the instance whenever I need fron any class.
Please clear my confusion about UiApplication.getUiApplication (). No matter what I'm doing wrong and how achieve what I'm trying doesn't mean created instance only once and call it whenever I need any class
Thank you
UiApplication.getUiApplication retrieves the current instance of UiApplication.
Please modify your code to convert, and then call the function like this:
((SimpleSmsChatApp)UiApplication.getUiApplication()).getChatScreen();
Tags: BlackBerry Developers
Similar Questions
-
Questions about discussions...
Hello
I have a new app to do that requires network access.
I have read this EXCELLENT post from peter_strange:
Because I can't use BIS - B because I'm not a partner of the Alliance, I wanted to take a look at the new OS 5.0 network API and see how it works.
I know that network connections should be performed in a separate thread.
I'm far from being an experienced Blackberry developer... so I have a few questions about discussions. I looked around the Internet, read on the forum, read the documentation, did some tests and so far, I came up with this code:
SerializableAttribute public class HTTPConnection extends UiApplication {}
Public Shared Sub main (String [] args) {}
HTTPConnection PAP = new HTTPConnection();
theApp.enterEventDispatcher ();
}public HTTPConnection() {}
pushScreen (new HTTPConnectionScreen());
}
}class HTTPConnectionScreen extends form {}
public HTTPConnectionScreen() {}
setTitle ("HTTPConnection");
Add (new RichTextField ("choose a type of connection :"));final RadioButtonGroup = new RadioButtonGroup() rbGroup;
RadioButtonField radioButtonF1 = new RadioButtonField ("Direct TCP", rbGroup, false);
RadioButtonField radioButtonF2 = new RadioButtonField ("WAP 1.0/1.1", rbGroup, false);
RadioButtonField radioButtonF3 = new RadioButtonField ("WAP 2.0", rbGroup, false);
RadioButtonField radioButtonF4 is new RadioButtonField ("BES/MDS", rbGroup, false);.
RadioButtonField radioButtonF5 = new RadioButtonField ("BIS-B", rbGroup, false);
RadioButtonField radioButtonF6 = new RadioButtonField ("WiFi", rbGroup, false);
Add (radioButtonF1); Add (radioButtonF2); Add (radioButtonF3); Add (radioButtonF4); Add (radioButtonF5); Add (radioButtonF6);
FieldChangeListener listener = new FieldChangeListener() {}
' Public Sub fieldChanged (field field, int context) {}
ConnectionThread ct = new ConnectionThread (rbGroup.getSelectedIndex () + 1);
CT. Start();
}
};
ButtonField buttonField = new ButtonField ("Connect", ButtonField.CONSUME_CLICK);
buttonField.setChangeListener (listener);
Add (buttonField);
}/ * method of onSavePrompt override default to avoid being asked if I want to record every time * /.
protected boolean onSavePrompt() {}
Returns true;
}
}class ConnectionThread extends Thread {}
private int transportType;
public ConnectionThread (int n) {}
transportType = tt;
}
public void run() {}
ConnectionFactory connFact = new ConnectionFactory();
ConnectionDescriptor connDesc = connFact.getConnection ("URL", transportType, null);
If (connDesc! = null) {}
try {}
HttpConnection httpConn = (HttpConnection) connDesc.getConnection ();
httpConn.setRequestMethod (HttpConnection.POST);
httpConn.setRequestProperty ("Content-Type", "application/x-www-formulaires-urlencoded");
OutputStream out = httpConn.openOutputStream ();
out. Write (Integer.ToString (transportType). GetBytes());
int responseCode = httpConn.getResponseCode ();
If (responseCode == HttpConnection.HTTP_OK) {}
UiApplication.getUiApplication () .invokeLater (new Runnable() {}
public void run() {}
Dialog.Alert ("- SUCCESSFUL CONNECTION-");
}
});
}
If (httpConn! = null) httpConn.close ();
} catch (IOException e) {}
System.Err.println ("IOException Caught:" + e.getMessage ());
}
}
}
}In fact, this code works very well... but I want to improve it, and I have a few questions:
1. I think that right now, every time I click on the 'Connect' button, I start a new thread. I would like to end this thread in the "run" method, but I don't really know how to access the variable 'ct' from there. Counsel on how to do it? Or maybe always use the same thread until my application is closed?
2. in the FieldChangeListener of my "Submit" button, I want to access the value of radio box. I did work, but I had to do my 'final' variable What is the right way to do it?
3 - to display a dialog box with 'Successful connection', I just wanted to write something in my main screen. How I do that?
I'm just a bit confused as to just what set up when you use a separate thread.
Thanks for your advice!
Edit: Hidden URL I connect to...
That's what I call a good question! (now I'm wondering why the forums do not work with opera correctly, in any case, here my baldy to the answer format): 1. your thread "dies" when it's over, no need to close it. 2 Yes 3. You can use a reminder. See for example http://www.javaworld.com/javaworld/javatips/jw-javatip10.html
-
I have about seven questions about Firefox OS. I'm potentially interested in opting for a tablet that works instead of Android or iOS. I couldn't find a place to ask questions like that. Thank you!
https://support.Mozilla.org/en-us/forums/Firefox-OS-English-Forum
There is another option.
-
About a month ago I posted a question about iMovie and not being able to "share". I solved the problem thanks, so no more emails!
Hi Michael,
If you want to stop receiving notifications by electronic mail, in the thread, that you have created, then I suggest that you follow the steps below:
One time connected to the Apple Support communities, visit your mini profile and select manage subscriptions.
Content
To manage this content, you are currently subscribed and changing your preferences, select the content.
Select next to see what content you are currently following. Note that any thread you are responding you subscribe you automatically to this thread.
You can select to terminate a subscription to a thread.
Learn how to manage your subscriptions
Take care.
-
Where and how do I ask questions about Email?
The Commission opening thingy is complicated, I have trouble finding my way around it. I don't know where or how questions about email. Is there an easier way than trawling through all these icons? Like a list or something - as you get on all other forums on the internet?
It would be a good starting point: Mac mini
Or the appropriate under MAC Os and system software section.
You might also find this useful: find answers and new questions
-
Many questions about the HP 50 g
I just ordered a HP 50 g graphic calculator! I have a few questions about this so hang on tight! What is the USB connector on the calculator? Mini-USB, micro USB, or is it a connector owner, "custom". Then, it would be possible to connect a keyboard to the HP 50 g by using the USB Port? Is there a program that would make this possible? (I doubt it would work if you plug it..) I have a Mini-USB to female USB 2.0 connector. So I could just plug the keyboard right, provided that the port on the calculator is a Mini-USB Port. If this is not so that I could use my female to female USB adaptor to connect the keyboard.
Thanks for your help,
Zekelegge
Hi!, zekelegge:
Welcome to Forum!
The only printer I use, 50G calculators, 48GII, 39GS and 17BII +, as well as many former models, such as the 48 s/SX/G/G + / GX, 38 G, 39 G, 42, 41 C/CV/CX and 28 C/S, is the infrared printer HP 82240 b. If you can use the emulator HP50G, on the PC, the simulator of the printer, you can download, since... http://www.HPCalc.org/details.php?id=7386
The printer... HP 82240 B
The cable series...
The description... http://www.allenwan.com/hpcalcserialcable/
The original cable...
-
Question about warranty after exchanges of RAM on Satellite module series
Hello together,
I have a question about the warranty. My laptop is 5 months old and now I want to improve it with more RAM. I want to do it myself, and now I'm wondering if the warranty will be getting hurt.
Thanks in advance for your answers.Concerning
TiG3r
For new models of laptops the RAM upgrade described in s operating manuals. It is public act and it shows the owner of the notebook how do RAM upgrade only.
If Toshiba offers something like this he won't have the negative influence of valid warranty.
Buy a compatible module and RAM upgrade.Bye and good luck!
-
A few quick questions about the Satellite P300 - 18 M
Hello
I am about to order a Satellite P300 - 18 M and have just a few questions about this:
(Although these may apply for other similar Satellite/Equium P300.)
Is the touchpad made by / to use the Alps or Synaptics driver?
It has the Wireless N network card, is the map made by Intel or Realtec?
And also, someone has experience with face recognition software to connect?
If so, does it take a lot of time to initalise?
Thanks in advance,
JackHello
The P300 - 18M belongs to the PSPCCE series.
It uses the two touchpad drivers. Synaptics & Alps Electric
There is an Intel 802.11agn minicards WLan installedThe face recognition is a nice tool but local to be illuminated and you must take your face the right of the post sometimes it of not very easy
But if you face is recognized correctly that the connection should work properly
See you soon
-
I recently bought a mini nb200 with windows 7 and I have a few questions about it. How can you set up your email, I was willing to put up with Outlook Express, but I don't know if I can. Also, is there a way to get a paper copy of the user manual?
You can download and install a new e-mail program when you download Windows Live via Microsoft Update. You can select the components of Windows Live, you want to include by checking a box for each you want. I installed all the. Or you can use Outlook, if you have Microsoft Office and you want to install it.
-
A few questions about the difference between the Satellite P70, L70, S70
Hello, I have a lot of questions about the P70, L70, S70 series that come with a 1920 x 1080 panel.
(1) what are the differences between the L70 and S70 series? With the exception of the RAM and HARD drive capacity, books seem pretty identical.
(2) P70, L70, S70 doesn't support a 2nd HARD drive or it's just the P70 series that support?
(3) all the three (P70, L70, S70 series) come with the same TFT panels?
(4) of the above series, which supports mSata?
(5) all the model of each series are delivered with support from mSata? For example, it could be that L70 - a - 13 m supports mSata is not the case of the L70-a-146?
(6) all the foregoing, are delivered with a S - ATA II or III S - ATA interface?
(7) who is the best of these series listed? I'm trying to understand what makes the big difference of S70 to P70 except for the envelope for example.
Thank you in advance.
> (1) what are the differences between the series L70 and S70? With the exception of the RAM and HARD drive capacity, books seem pretty identical.
What models Sat L70 and S70 do you mean exactly? There are different L70-xxx-xxx and S70 models on the market that supports different hardware specifications.
(> S70 2) P70, L70, support a 2nd drive HARD or is - it just the series P70 that support?
As you can see in this [Sam P70 HDD replacement document, | http://aps2.toshiba-tro.de/kb0/CRU3903II0000R01.htm] the P70 series supports the 2nd drive Bay HARD, BUT even if there is a 2nd HARD drive Bay, this does not mean that you can use the 2nd HARD drive. In the case where the 2nd HARD drive Bay are equipped with HARD drive connector, you can use the 2nd HARD driveI also found the [Sam L70/S70 HDD replacement | http://aps2.toshiba-tro.de/kb0/CRU3703HG0000R01.htm] the document on the Toshiba page and there I see this 2nd HARD drive Bay is not available
(> 3) all three (P70, L70, S70 series) come with the same TFT panels?
See point 1). Different P70, L70, S70 models were equipped with different material parts.(> 4) of the series above, which takes in charge mSata?
As far as I know that some P70 models are equipped with an mSATA SSD of 256 GB.(> 5) do all the model of each series are delivered with support mSata? For example, it could be that L70 - a - 13 m supports mSata is not the case of the L70-a-146?
See point 4) not all models supports the same hardware specifications(> 6) all of the above, come with a S - ATA II or III S - ATA interface?
I don t think that SATA III is supported. I guess it would be SATA II(> 7) which is the best of these series listed? I'm trying to understand what makes the big difference of S70 to P70 except for the envelope for example.
Not easy to answer because there are too many models released in Europea.
And not all models are available in each country. So I guess you will have to look for the models that have been released in your country. -
Satellite L650-11R - a few questions about this
Hello there :-)
I have a few questions about my new L650.
I've never had Toshiba notebook before so I apologize if some of these "quirks" are actually quite normal on this laptop. I really want to hear the views of other users L650.
1)
First of all, by the time I turned it on I saw gradient thin (1-2 mm) along the right edge of the screen that goes from the bottom up. Maybe "degraded" isn't the right word, but it seems that since two or three pixels are kind of discoloration or lose brightness/sharpness to the edge along the straight bezel. It is not really that visible, looks like the colors are desaturated a bit here or brightness is a bit lacking. He can be seen everywhere (bios or no color in Windows, but better in the lighter background).
The left side (or other) seems ok, all this along the right edge is somewhat suspicious. If one can compare? I don't know if it's something to worry about or is just supposed to be like that.2)
The other thing I noticed heating of the processor (Intel i3 330M) and GPU (ATi Mobility Radeon 5650). It's pretty hot here right now (I would say that the temperature is around 28 degrees Celsius when using cell phones). He is sitting on the hard surface (table) and nothing is blocking the vents.
However, at "rest" (surf the web & regular light stuff), average CPU temp hovers around 58 ° C. It usually goes from 45 to 62 in just a few minutes after starting, and then I can hear and see (Toshiba PC Health Monitor) evacuate the kicks in. Temp goes back to 50 +, event stops and then the temp rises to 60 + until the vent is used again.
During load full (Prime95 or some games), CPU is going all the way up to 75 degrees (the highest being 77). Fan runs at 75 to 77% during this time, never go faster.GPU idling is usually around 5 degrees above temp CPU (62-65). During full load (for example. Benchmark of Far Cry 2), I see a lot of stuttering with the latest drivers Catalyst and DX10 (not sure if the stuttering has something to do with heat), otherwise it is ok (no artifacts or anything like that). Temp of GPU during the loading goes up to 74-75, fan speed is locked at 30%, the frequency of the heart 5650 is 450 MHz. left side of the laptop (vent and below) is pretty hot, while the keyboard is warm (or slightly warmer who who).
These time seems correct and safe in the long term? I'd rather events works all the time (they aren't really very strong) and keeping time less than 50, but there are just wishful pious bios control events and I can't control not the bios. :-)
3)
This is just General related products. :-)
Official specifications of Toshiba L650 say ATi 5650 (between other low range GPU), but I saw a few specifications calling for there 5730 (same model 11R). Is there really a Satellite L650 with ATi 5730 GPU models?Sorry for the long post, I tried to include the best possible description that I could do. :-)
Thank you in advance.
Thanks for the additional info!
-
Hi there, I have a question about storage, even if I have 2, 53GB, storage watch 21, 99GB usage, why this difference? I use an iMac 2009, thank you!
Spotlight re-indexing.
-
A few questions about the upgrade on Satellite A300-144
Sorry for the typos, English is not my mother tongue.
I want to ask some questions about the upgrade of a300-144.* Some info first.*
CPU: T2370 ([http://ark.intel.com/products/34445/Intel-Pentium-Processor-T2370-1M-Cache-1_73-GHz-533-MHz-FSB]).
Chipset: GM965 ([http://ark.intel.com/products/29821/Intel-82GM965-Graphics-and-Memory-Controller]).* Questions.*
1. my frequency of laptop memory at 533 MHz, supports 667 MHz memory controller, memory modules can work at 667 MHz. Is - this because CPU FSB 533 MHz frequency and new processor at 667/800 MHz FSB will fix it or it is hardcoded in the BIOS?
2 Intel said that the size of max memory for my chipset is 4 GB (2 x 2 GB), but Toshiba says that only 2 GB (2 x 1 GB), who is right?
3 I know, taken of my CPU is μFCPGA-478 aka socket P, max FSB 800 MHz, max 35 W TDP, so T9500 ([http://ark.intel.com/products/33918/Intel-Core2-Duo-Processor-T9500-6M-Cache-2_60-GHz-800-MHz-FSB]) is a compatible processor or there are some limitations in the BIOS?
> 1. My frequency of laptop memory at 533 MHz, supports 667 MHz memory controller, memory modules can work at 667 MHz. Is - this because CPU FSB 533 MHz frequency and new processor at 667/800 MHz FSB will fix it or it is hardcoded in the BIOS?
The speed of the memory is related on the material. This means that the FSB is responsible for the limitation.
If the FSB would allow support 667 MHz then the memory would also at this speed.> 2. Intel says that the size of max memory for my chipset is 4 GB (2 x 2 GB), but Toshiba says that only 2 GB (2 x 1 GB), who is right?
The memory depends on the chipset. So if the chipset supports 4 GB of RAM, you should be capable of this move to 4 GB of RAM> 3. I know, my CPU is? FC-PGA-478 aka socket P, max FSB 800 MHz, max 35 W TDP, so T9500 (http://ark.intel.com/products/33918/Intel-Core2-Duo-Processor-T9500-6M-Cache-2_60-GHz-800-MHz-FSB) will be a compatible processor or there are some limitations in the BIOS?
It might be possible that the new processor would be fully supported by the BIOS, but in most cases it should not be a problem if the chipset would support the new processor.
But as far as I know the upgrade of the CPU is not supported by Toshiba or any other manufacturers of portable and its your own risk to run laptop with the new processor. -
Satellite A350D - 20K - Question about upgrade second HDD + Temperature
I have a question about my laptop. I have notticed it is a second location of HARD disk on the bottom.
Is it possible to use this to increase my storage?
And if yes, how do I do that? I don't see all the connectors.
What type of HARD drive to use in case it is possible to use this slot machine?My second question is on my laptop to be very hot after a short period of use.
I installed speedfan to record the temperature. When I start the laptop, it already is between 45 and 50 degrees.
He stayed there for half an hour and then it starts to get warmer. When I start to use the laptop for anything, it triggers to between 70 and 80 degrees.This does not seem normal to me. I tried to clean the vents with compressed air, but it has not made a difference.
I searched on the internet how to take the laptop part for proparly cleaned TI.
But I can't so I'm looking that destroy it.This could be the cause and more importantly, how can I solve this problem?
Tom
The second HARD drive bay contains the HARD drive connectors?
If Yes, then you can use a SATA 2.5 HARD.
If there are no connectors, then you will not be able to use the second HARD drive> I have installed speedfan to record the temperature. When I start the laptop, it already is between 45 and 50 degrees. He stayed there for half an hour and then it starts to get warmer. When I start to use the laptop for anything, it triggers to between 70 and 80 degrees.
CPU and GPU produce a lot of heat. The heat dissipation is always created then there s nothing unusual that the temperature rose to higher level.
You can change the settings in Win 7 power management. You can set the CPU to lower performance and can increase the activity of fan, which will help lower the temperature. -
Question about temperature internal Satellite A300 ND1
Hello
I have a question about the temperature of the standards it of ok for my laptop and what is the normal temperature and how can I keep it low?
Thank you.
Hello
It's not easy to say what a normal temperature could be.
The temperature is not always the same and it depends on the use of the laptop.
Usually, the temperature would increase while gaming or running applications high performance. Why? Because all devices such as the CPU and GPU would focus the heat dissipation and this leads to a higher temperature.> How can I keep it low
Very simply, you can keep still low level, but you can make sure there is enough free space around the laptop to ensure good air circulation.
Also don t use the laptop on your knees etc in order do not obstruct cooling fans.It s also advised to clean the fans from time to time using the jet of compressed air. These sprays are really useful and could buy in the stores of different computers.
Maybe you are looking for
-
Is there a bar more research? It is not in the customization or options, so how do I turn it on. Or do I need an add-on?
-
Upgradable GPU? Graphics for the next models?
Hello! I think to buy a satellite M40 that precisely fits my budget. The only problem is the X 300 128 MB graphics card which is in fact the slowest in ATI series x is there a possibility or the possibility of an update of the graphics card or throug
-
I'm trying to float a previous post to the top of the discussion list. The instructions I've read says to click on the arrow to the right of the message posted to float it, but I don't see an arrow?
-
use file Spreadhseet read 1 extra row each iteration of the loop
Hello I wrote a program that uses number of data points according to the specified user to the settings. For each data point, I use a Spreadhseet VI reading to correct each data point according to the calibration spreadsheets I've already saved. For
-
Sorry if this is a repost, I searched the forums and found nothing on it. I'm new on the RAZR and ICS. I figured out how to turn off applications, but whenever I have to disable Google Books and play game Google movies, they just pop back up on the l