the problem is in for loop. note Log.d prints only 0 than the my problem crashes.
this code seem right to me. is there any thing iam missing? - public class test extends Activity implements View.OnClickListener {
-
-
int idArray[] = { R.id.imageButton1, R.id.imageButton2, R.id.imageButton3,
-
R.id.imageButton4, R.id.imageButton5, R.id.imageButton6,
-
R.id.imageButton7, R.id.imageButton8, R.id.imageButton9,
-
R.id.imageButton10, R.id.imageButton11, R.id.imageButton12,
-
R.id.imageButton13, R.id.imageButton14, R.id.imageButton15,
-
R.id.imageButton16, R.id.imageButton17, R.id.imageButton18,
-
R.id.imageButton19, R.id.imageButton20, R.id.imageButton21,
-
R.id.imageButton22, R.id.imageButton23, R.id.imageButton24,
-
R.id.imageButton25, R.id.imageButton26, R.id.imageButton27,
-
R.id.imageButton28, R.id.imageButton29, R.id.imageButton30,
-
R.id.imageButton31, R.id.imageButton32, R.id.imageButton33,
-
R.id.imageButton34, R.id.imageButton35, R.id.imageButton36,
-
R.id.imageButton37, R.id.imageButton38, R.id.imageButton39,
-
R.id.imageButton40, R.id.imageButton41, R.id.imageButton42,
-
R.id.imageButton43, R.id.imageButton44, R.id.imageButton45,
-
R.id.imageButton46, R.id.imageButton47, R.id.imageButton48,
-
R.id.imageButton49, R.id.imageButton50, R.id.imageButton51,
-
R.id.imageButton52, R.id.imageButton53, R.id.imageButton54,
-
R.id.imageButton55 };
-
-
Button buttons[] = new Button[idArray.length];
-
-
-
@Override
-
protected void onCreate(Bundle savedInstanceState) {
-
super.onCreate(savedInstanceState);
-
-
for (int i = 0; i < idArray.length; i++) {
-
Log.d("DEBUG", " "+i);
-
buttons[i] = (Button) findViewById(idArray[i]);
-
buttons[i].setOnClickListener(this);
-
}
-
}
-
-
-
@Override
-
public void onClick(View view) {
-
-
}
1 1259 Nepomuk 3,112
Recognized Expert Specialist
Well, nothing that I can see is definitely wrong; however I don't know what the error message is. What exception is thrown? What is the stacktrace? Have you tried debugging this to see, where it crashes? I'm assuming it's in line 32 or 33.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Robert |
last post by:
Im having a problem with an array that is put into a session. I want
to be able to remove any element, but when I loop through to display
them, it doesnt work right. I believe its because of the...
|
by: Zenobia |
last post by:
I have a problem. I need to look up several values stored in
arrays. Each value is stored as a pair. The first (number)
represents the probability of this item occurring. For instance,
in the...
|
by: engartte |
last post by:
Hi all,
I did the solution with consultation of some experts on the following
problem:
Declare an array of length of 10 and read integers into the elements of
the array from keyboard.Then...
|
by: farmer |
last post by:
I need to populate a listbox of other listview with selected listview
items.although the following code works perfecty I want to use an
Array (for various reasons)
for Each ListItem In...
|
by: helldiversafe-news |
last post by:
Hi all,
I will use a apache soap service with an .net c# client and have a
problem with an complex array:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope...
|
by: julian_m |
last post by:
let's say that I've an array like this:
$AL_array = Array (
=> Array ( => 1 ) ,
=> Array ( => 2 ) ,
=> Array ( => 3 ) ,
=> Array ( => 4 ) ,
=> Array ( => 1 ) ,
=> Array ( => 2 )...
|
by: SpreadTooThin |
last post by:
Basically I think the problem is in converting from a 32 bit integer to
a 16 bit integer.
I have two arrays:
import array
a = array.array('L', )
b = array.array('H', )
b = a
|
by: arda |
last post by:
how i can put 2d array to a pointer? In the below program i am giving a first value to output_bit and then start to a loop and putting the new values to an another array as called newdata. But as i...
|
by: Toni |
last post by:
I have ImageButton array. I have defined onClick event and it works. But in
this function I can not use control propetries. I want to use index of
ImageButton which is clicked and ImageURL...
|
by: Robert Bevington |
last post by:
Hi all,
I ran into memory problems while tying to search and replace a very large
text file. To solve this I break the file up into chunks and run the search
and replace on each chunk. This...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |