During the writing...

Hello

It's my code... here we touch, when we click on that image is displayed on the same screen... If I click this button again another image is happening below this picture... what I want is, when I click this button 2 times, I don't want another picture below... I want to replace this image.

import java.io.DataInputStream;

import javax.microedition.io.Connector;
import javax.microedition.io.file.FileConnection;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.container.MainScreen;

public class ImageEx extends UiApplication
{
public static void main(String args[])
{
ImageEx ie=new ImageEx();
ie.enterEventDispatcher();

}
public ImageEx()
{
UiApplication.getUiApplication().pushScreen(new ImageScreen1());
}

}

class ImageScreen1 extends MainScreen implements FieldChangeListener
{
    ButtonField button;
    FileConnection fileconnection;
    DataInputStream dis;
    public ImageScreen1() {

      button=new ButtonField("Get Image");
        add(button);
        button.setChangeListener(this);
    }

    public void  fieldChanged(Field f,int content)
        {
            if(f==button)
            {
                gettingImage();

            }   

        }
        void gettingImage()
        {
            try
            {
        String path="file:///SDCard/B7.png";
          fileconnection = (FileConnection) Connector.open(path,Connector.READ);
            if(!fileconnection.exists())
            {
                fileconnection.create();

            }         

          int length=(int) fileconnection.fileSize();
          byte[] data=new byte[length];
          dis=fileconnection.openDataInputStream();
          dis.readFully(data);

         Bitmap bitmap= Bitmap.createBitmapFromPNG(data, 0, length);
          BitmapField bitmapfield=new BitmapField();
          bitmapfield.setBitmap(bitmap);
          add(bitmapfield);
          dis.close();

        }

        catch(Exception e)
        {
            e.printStackTrace();

        }
        finally
        {
            try
        {
            fileconnection.close();
        }
        catch (Exception e)
        {

        }
        }

    }

}

Use the Global bitmapfield object and do not add it again.

Thank you

Concerning

Abhijit-

Tags: BlackBerry Developers

Similar Questions

  • How to use notes during the writing of my book with pages?

    How are used to write a book with pages of notes?

    You need the Apple EndNote plug-in for Pages v2.0and the EndNote 7.3.4 application (or later version) installed for compatibility El Capitan. With the plug-in installed and EndNote works, then you start Pages v5.6.1 and the Insert menu: reference EndNote is available for use. Launch Pages v5.6.1 prior to 7.3.4 EndNote and endnote reference entry in the Insert menu is not active.

  • M40-277: the laptop is very slow, during the writing of CD/DVD

    Hello

    I have a problem with my DVD writer. When I try to write a CD or DVD with my laptop, my laptop is very slow, I can barely move my mousepointer and my buffer State maintains have failed (see screenshots). Even when I try to play a CD or DVD it slows down my laptop. I don't know what the problem is. Can someone help me?

    I have this laptop: "Satellite M40-277" with the DVD-RAM UJ - 841S.
    Screenshots:
    http://users.skynet.be/fa027951/s1.jpg
    http://users.skynet.be/fa027951/s2.jpg
    http://users.skynet.be/fa027951/S3.jpg

    Thank you.

    Hi Gianni,

    I use Nero to burn DVDs, and one of the configurable options is the task of "priority". If I set it to 'high' then my phone behaves as you described, that is very slowly. Check if you have you encode/burn too high task priority.

    Kind regards

  • During the new installation of xp pro, the program never asked for the product key or what type of network installation.

    XP pro ie8 32 bit svc pk 3.

    during a new installation http://aumha.net/viewtopic.php?f=62&t=44636, most of the steps was OK, however, my product key was not for and type of network was not.

    As the third so clean installation I did, do you think the pc is to remember my preferences?

    Thanks for any help.

    I think that when you install XP and turn on the first time, Microsoft collects information from your system during this process to develop a signature of material that goes with your license and store it away.  Of course, they do not collect any personal information :)

    They do it so that if someone takes your XP installation license and tries to apply it to another computer (it is piracy) that the installation would not activate as your activation must match your hardware.

    If someone tried to install and activate your license on another machine with a different set of hardware, MS would say, wait a minute - this license has already been activated on another machine, and he could complain.  Then someone has some ' splaing to do.

    I suspect that in your facilities in 2nd and 3rd, MS takes a look at things and said... this material signature and the license already go hand in hand, that nothing has changed here, so it is not necessary to activate again, all right.

    This is why, if one day you need to replace your motherboard and reinstall XP, even if you have everything and it's all legitimate, you will probably have to reactivate again since the signing of material would be completely different for this license that MS remembers the first activation.  A few small hardware changes, that you can get away with, but if the number of points collected to compensate for the signing during the initial activation is too different, you will need help activating.

    In this case, if things are legitimate, you can call MS activation team, and if you can convince them that there is no hacking involved and you just have to change your motherboard, they work with you to get your reactive stuff.

    Since you are looking at AUMHA, they have a writing little upward about it here, but there are official documents of Microsoft you can read also ('points' and how they work):

    http://aumha.org/win5/a/WPA.php

  • What is confirgaration 213:11 error occurring during the opening of adode software that has already been installed

    What is confirgaration 213:11 error occurring during the opening of adode software that has already been installed

    Hello

    This error appears when you don't have access to read/Wrire in file required to run Software (SlStore)

    > Try to run the Application as administrator (right click on the Adobe application and select run as administrator)

    > See

    Error "license store does not allow writing | Install log | CS5, CS5.5

    > Meanings must solve if it does not reinstall the Application

    Let us know if this helps

    ~ Assani

  • TimeoutException - during the web service method call that opens a PDF file

    I am updating a legacy program that uses Adobe Acrobat Professional 7.0.  The idea is that the customer is calling web service methods, which manage open a PDF file, reading or writing in the PDF file, if necessary and closing.  He then returned data (if reading) to the client.

    The only problem with what I'm having is that the client will take a break for about 60 seconds and raise a TimeoutException.

    I know that the method on the end of web services works, because I wrote a quick driver who calls the same method, but it is running normally and works perfectly.

    My question is, basically, what would cause the client to be block/gel during the call to the web service method to perform this operation? Everything works on my workstation, and I've debugged to see that filename passed is the same in both tests.

    Thank you!

    This would be better addressed in the forum of the Acrobat SDK kit.

  • Prevent the writing-merging with writeback

    Hi all

    I am very interested in the writeback feature, but I would like to disable optimization writing-merging for each.

    Is it possible to do this?

    In my view, the fact that CacheStore.storeAll (map entries) works on cache-key-value/cache makes it impossible to have several cache value of the same key :-( Do not merge the consecutive changes on a given entry will be needed to have a method like CacheStore.storeAll (< change > list) with change with Amendment (insert/update / delete), the key and the value.


    Thank you

    Cyrille
    --
    Cyrille the cleric
    [email protected]
    http://blog.xebia.fr

    Hi Cyril,.

    In my view, there is no way to prevent completely Coalescent updates in the same entry, as for example in the case where the database is down for an extended period and there are several updates of the same cache entry during the downtime of the database, you will inevitably lose the previous input values.

    Best regards

    Robert

  • I have problems to restart of Yosemite, after power failure during the new backup, and now HD is also blocked.

    I have problems to restart of Yosemite, after power failure during the new backup, and now HD is also blocked.

    I tried the holding of 'command-r' and 'option' to see if the problem can be resolved or try any boot from a boot disk, my old backup, USB function start - but after a slow long process it all just stops.

    There is software on my HD that I don't want to lose by simply reformatting the computer, because I am now in a different country, far from my house, which is another problem of the Apple Store, to reinstall my OS from Yosemite on the www.

    Hey AmnonMikeCohen,

    Thank you for being a part of the communities of Apple Support.

    I understand that your Mac is not start properly after the power went out.  Let's start with resetting the SMC and NVRAM on your Mac and see if he can start from there:

    Reset the management system (SCM) controller on your Mac.

    How to reset the NVRAM on your Mac.

    See you soon.

  • Whenever I try to update my iPhone 6 for the ios10 it is said it is impossible and that an error occurred during the installation? I ' have enough free space, so I'm not real why he keeps now.

    Whenever I try to update my iPhone 6 for the ios10 it is said it is impossible and that an error occurred during the installation? I ' have enough free space, so I'm not real why he keeps now.

    Try to update via iTunes.

    See you soon,.

    GB

  • iCloud backup after iOS 10 - some files were not available during the last backup

    HI - we are a company with about 350 users of iPhone and iPad.  I put this in the iCloud in the community section, but I've seen other users have the same problem in this section, so I thought I would add here.

    In order to stop users add their own e-mail accounts on the iPhone that lock us the device through restrictions - deactivation of the accounts section.  It stops and then access the iTunes settings.  In the test of iOS 10.0.1, we have one of the devices (a 16 GB 5 s, who had been a backup at 7:20 that morning), improved 9.3.2 that went well with no obvious problems, then, after a few days to leave the handset to the function, we have lifted the restriction and the backup on iCloud to find any backup not occurred since the upgrade and a message 'some files were not available during the last. backup"in its place.

    If all our staff upgrade their phones (we gave says not yet) then the backups look like they stop.  It is easy to fix, as a manual backup, will complete the process, but you have to remove the restriction to do this.

    We tested on iPhone 5, 5 s, air iPad iOS 8 to 9.3.5 and all have this problem.

    I have exactly the same problem, 16 GB iPhone 5s as well. I plan on raising at my Genius Bar appointment today.

  • Mac lost during the installation of windows

    When installing windows on a MAC, I deleted my partition mac completely and I am now left with windows 7 to my mac book air. Y at - it an option to install mac, I don't mind losing the windows partition

    Hello smarthala,

    Thank you for using communities of Apple Support.

    I see that you deleted by mistake your Mac partition during the installation of Windows. The partition itself deleted or was it the Mac OS that has been erased, leaving an empty partition?

    If the latter, you can reinstall OS X from OS X Recovery. See this article for how that should be done: On OS X Recovery
    Otherwise, you can use Internet recovery (Command-Option-R, as opposed to the command-R) to repartition the entire hard drive and install the version of Mac OS X provided on your Mac. Who is finished, you can upgrade to El Capitan via the App Store > bought.

    Best regards.

  • Cannot complete the order after the iPhone booking 7 during the pre-order?

    Not sure if this is the appropriate place to ask... but did anyone encounter this problem with their iPhone 7 pre-order?

    After that I tried to place an order for the iPhone 7 more during the pre-order, I received an email from the Apple Store saying that my iPhone had been reserved and provided me with a reservation number. They said that they send an email when they were able to reach the carrier systems so I could place my order. Very quickly after I got a follow-up email confirming the booking number and was told that I could now go ahead and place my order. I have connected to the Apple Store, who acknowledged my reservation number, almost all of the screens orders went through, but when I hit continue to confirm the pricing plan that I had selected, the next screen shows the page of 'the page you are looking for is not found' dreaded.

    E-mail with the reservation told me that I don't have that until 4 PM PDT 9/10 to complete this order. Everyone knows this! I tried through the app store of Apple, Safari, and Chrome... and always get the same question. I've been on hold with Apple now for 45 minutes trying to get through, and they don't take chat requests. I'm so frustrated! Help!

    The site is probably hammered with requests for pre-order. I'll try again later if I were you.

  • During the migration of projects opening in PICTURES project names will appear on the News Photos 'albums '?

    Prepare my Aperture library (with deep levels of files/projects/albums) to migrate to pictures.  I want to know if the NAMES of my files/projects/albums will be kept in Photos and will appear in the new view of photo albums.

    Using Aperture 3.6 and pictures is up to date. 10.11.6 OSX

    Yes, they migrate. To more easily confirm everything is fine select see the sidebar on the view menu. Also, your current Aperture library will remain unchanged during the migration, if youre not really take risks by trying.

  • iPhone disconnected during the software update

    My iPhone 5 has been connected to iTunes on my PC and I started a software update.  The phone disconnected during the update due to a bad cable.  Now my phone is locked to the screen update showing the apple logo.   I can't turn off it normally to reboot and iTunes does not recognize the phone when I plug it back on my PC.   Any ideas?

    Use the recovery mode as described here.  You may try to go into recovery mode more than once to succeed.

    If you are unable to update or restore your iPhone, iPad or iPod touch - Apple supports

  • Heart rate does not during the workout

    during an intense workout, my watch seems to think that my heart rate is only 50 BPM or less - starts ok, but then cela and will not regenerate little matter what I do

    no idea why?

    I can confirm that no tattoo wrist watch is super tight and do exercises like rowing or spinning - in weightlifting, he seems fine

    Operating system is up-to-date

    Thank you

    Hello

    Apple says that, even in ideal conditions, Apple Watch may not be able to save a reliable heart rate monitor each time reading for everyone.

    For best performance of the sensor of heart rate during the training, Apple suggests you consider your clamping beforehand watch band and he loosen again thereafter.

    The sensor is also likely to give better results for workouts that involve rhythmic (for example running) rather than the irregular movements (for example boxing). Other problems that can affect the performance of the sensor include the perfusion of the skin and wrist tattoos.

    If your workouts involve flexing your wrists (for example what weight lifting, for example), it can help to keep your watch a little higher on your arm, the joint in flexion.

    More information:

    Your heart rate. What it means, and where on Apple Watch you will find. -Apple Support

    Use of the workout on your Apple Watch - Apple Support

    If you continue to experience problems, for more consistent measures, you may wish to a heart rate monitor external matching / Bluetooth chest strap for your watch:

    Use the Bluetooth with your Apple Watch - Apple Support Accessories

Maybe you are looking for

  • Using table of numbers

    Hello If I'm in number and I'm trying to change my name of the Table to include a brief description under the title / name, love; "Included in this list, you get... registration" How should I do this?

  • my new iphone SIM card tray is blocked

    my new iphone SIM card tray is blocked

  • SVF152C29M lights when the charger. The charging light also lights.

    I checked the charger, it gives about 21.5 V and I opened the laptop and it seems to have the tension on most of the components. Windows warned me that the battery has been a failure. Is it possible that this laptop won't turn on because of a failed

  • Read xml from url

    Hi all I'm trying to get the data from this particular url: http://api.openweathermap.org/data/2.5/weather?q=London&mode=xml I have no problem to scan directly from a .xml or xml string. But I can't read the data directly from labview or even save th

  • custom movement indicator

    I have a chart or search the table that I update.  The data entered somewhere else on the VI and when you press the button "Refresh" the data is entered in the table according to the current value of the other data.  I want to inform the user of the