开发者

Help with Android App Idea

开发者 https://www.devze.com 2023-02-02 07:24 出处:网络
Being a starter in Android programming, I would like to ask some help here regarding my idea to create an app. For example, there is a list of sign language pictures on my application from a-z, how ca

Being a starter in Android programming, I would like to ask some help here regarding my idea to create an app. For example, there is a list of sign language pictures on my application from a-z, how can I put an output text on a textfield when i clic开发者_JAVA技巧k on the picture..i know this is a basic question but it would be very helpful to me if someone helped me..:) thank you..and happy new year:)


I would heartily suggest heading to Google's Android Developers Page. A large amount of resources are available, including sample code.


You'll need to bind to the onClick() method of your images and speficy an onClickListener object that updates the TextView/EditText.


Just to toss this out there ... if you have not checked out Google's Android App Inventor yet then definitely take a moment to see the tools they have freely available. Along with the tools they have several neat tutorials that might help spark app ideas.


If your list of images is being managed by an adapter, match the list with a list or array of names which you can then use to update the TextView by using the position of the image clicked in the list. I use a similar approach with a Gallery of icons and a TextView :

final TextView name = (TextView)findViewById(R.id.imageChosen);
    name.setText(mImageNames[mInitialImage]);

    g.setOnItemClickListener(new OnItemClickListener()
    {
        public void onItemClick(AdapterView<?> parent, View v, int position, long id)
        {               
            name.setText(mImageNames[position]);
            mListener.imageChanged(position);
            dismiss();
        }
    });
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号