Phone book call error

Excuse me again if I disturb you, but I would like to be sure that the error I will show you is caused by my obviously incorrect programming and not again for other reasons.

I have created a phone book, as shown in the images, but when I press the corresponding number, a call is made to a different number, where am I wrong?

Use the List picker.Selection rather than select list item blocks. .

Also let me suggest you to create another list with the numbers and select the corresponding number from the number list using the List picker.SelectionIndex to reduce the number of blocks

Taifun

It looks like you first should learn some basics...

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials Tutorials for MIT App Inventor to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

I tried with listpicker, but it won't let me insert images with numbers.
List View allows you to write information in two different colors

So if you could help me use listview, so that when I click on the corresponding number, the call automatically starts to that number and not to a random number in the list as it happens.
Learning as you say, you can also do it from your own mistakes, so what's wrong in my project and a selection of a listview that should make the phone call to a number specified in the code?

Read again my first answer
EDIT: You are using a listview... there also is a Listview.Selection property...there is not much difference between listpicker and listview...

Taifun

I figured out that I should use List picker.SelectionIndex to decrement the blocks but a my blocks are only 16, by 16 numbers, so I don't think that's a problem.
Also as I wrote, I can't use List picker, because it doesn't allow me to insert images and color two texts with different colors from each other, if you know how to do it please give me an example of blocks, but not with picker lists, if I will not be able to insert the images of the numbers and as I repeat, color the text in two colors.

cc90fb57d5eb1e31fa935afe6398ea76bbe69965_2_690x388

You are assuming the IF block can read your mind, and know more than you feed it.

The IF block can only accept a true or false value, usually from an '=' or '<' or text CONTAINS block.

But there aren't any of those blocks feeding the IFs.

If you insist on using that collection of IF blocks, each would need a comparison of 2 values, perhaps the selection index from the ListView, and the '113' value, or perhaps the front part of the file name of the graphic file you used for showing a big '113' on the left.

Besides the ID misunderstanding, you have fallen into the trap of enumerating the items in a list and coding explicit code for each list item, rather than using the parts of the ListView.Selection value for your phone number. Look in the ListView blocks for the blocks that can return the three different parts of a ListView Element, once Selected.

1 Like

Grazie a tutti

Ok grazie

Same here.

That's why i started a bunch of FAQs.

AI2 is good for low-memory coders, because of its pallette system, its component folders, and how its blocks have tool tips that will pop up and hover over them. There is a (?) link after each component in the Designer pallettes with that component's help page.

Naming your variables, procedures, and components well can help relieve the load on your memory.

You might use something like this to get the phone number from the ListView.Selections ...


at the cost of having to keep the phone number in DetailText of the Selection, and both the English and Italian descriptions in the Main Text portion, separated with a \n line feed.
Sorry, the descriptions would be the same color.

If it can't be done otherwise, thanks again very much, I'll try your suggestion.

I solved this way


This way I could use the listview with text colors.
Thanks everyone anyway

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.