And look for list view.java.
Reading the original components is a good way to learn and understand how AI2 works
And look for list view.java.
Reading the original components is a good way to learn and understand how AI2 works
I hope these can give you an idea
@SimpleFunction(description = "")
public void Add(){
String[] myData = {"Visual Basic .NET", "Java", "Ruby"};
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(context, 17367043, myData);
listView.setAdapter(arrayAdapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
ItemClicked(position);
}
});
}
@SimpleEvent(description = "")
public void ItemClicked(int position) {
EventDispatcher.dispatchEvent(this, "ItemClicked", position);
}
You're Welcome
@Salman_Devwhen I use this code with some changes this give me error
popup.setOnMenuItemClickListener (PopupMenu.OnMenuItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
OnClick(position);
}
});
@SimpleEvent(description = "")
public void OnClick(int position) {
EventDispatcher.dispatchEvent(this, "Onclick", position);
}
Error
Started Compiling Project Popup
Buildfile: /compiler/android/build.xml
javac:
[mkdir] Created dir: /compiler/android/build/zjiyT/classes
[javac] Compiling 1 source file to /compiler/android/build/zjiyT/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] /compiler/android/src/zjiyT/com/faraz/popup/Popup.java:59: error: expected
[javac] popup.setOnMenuItemClickListener (PopupMenu.OnMenuItemClickListener() {
[javac] ^
[javac] /compiler/android/src/zjiyT/com/faraz/popup/Popup.java:59: error: expected
[javac] popup.setOnMenuItemClickListener (PopupMenu.OnMenuItemClickListener() {
[javac] ^
[javac] /compiler/android/src/zjiyT/com/faraz/popup/Popup.java:59: error: ';' expected
[javac] popup.setOnMenuItemClickListener (PopupMenu.OnMenuItemClickListener() {
[javac] ^
[javac] /compiler/android/src/zjiyT/com/faraz/popup/Popup.java:61: error: ';' expected
[javac] public void onItemClick(AdapterView parent, View view, int position, long id) {
[javac] ^
[javac] /compiler/android/src/zjiyT/com/faraz/popup/Popup.java:61: error: ';' expected
[javac] public void onItemClick(AdapterView parent, View view, int position, long id) {
[javac] ^
[javac] /compiler/android/src/zjiyT/com/faraz/popup/Popup.java:61: error: not a statement
[javac] public void onItemClick(AdapterView parent, View view, int position, long id) {
[javac] ^
[javac] /compiler/android/src/zjiyT/com/faraz/popup/Popup.java:61: error: ';' expected
[javac] public void onItemClick(AdapterView parent, View view, int position, long id) {
[javac] ^
[javac] /compiler/android/src/zjiyT/com/faraz/popup/Popup.java:61: error: expected
[javac] public void onItemClick(AdapterView parent, View view, int position, long id) {
[javac] ^
[javac] /compiler/android/src/zjiyT/com/faraz/popup/Popup.java:61: error: not a statement
[javac] public void onItemClick(AdapterView parent, View view, int position, long id) {
[javac] ^
[javac] /compiler/android/src/zjiyT/com/faraz/popup/Popup.java:61: error: ';' expected
[javac] public void onItemClick(AdapterView parent, View view, int position, long id) {
[javac] ^
[javac] /compiler/android/src/zjiyT/com/faraz/popup/Popup.java:64: error: illegal start of type
[javac] });
[javac] ^
[javac] 11 errors
[javac] 1 warning
His code looks correct
So Why I get error
You are just copy pasting the code.
As I said, you just pasted the code, the code is not even inside any method function.
that code was for listview you copied and pasted it in popupmenu code it is totally wrong
@Faraz_Firoz just my opinion, learn basics, if you think you know basics, you are wrong, you cant learn it all in some weeks, its a time taking and lifetime useful thing, I myself spent many months with support of @Aarush_Kumar , @newbiedeveloper, @Pradevel to learn basics and now, I know it
human mind can be slow but, once it learns, nothing is impossible
I once learned table upto 20 but now I have forgotten it
Taifun
Amen. I often joke that your knowledge is inversely proportional to the number of degrees you hold. In high school, you know everything, and by the time you have a Ph.D., you know absolutely nothing .
true, world is full of endless knowledge and you yourself prove yourself as an idol for many people even me
Really ? I have 0 degrees . What you think ? How knowledgeable person I am ?
That's why it's a joke...
"Experience is the only genuine knowledge"
I need a help from you. Can you tell this sentence to my Teacher ?
No More Home Works
At the end, this topic is became wonderful