First of all, this article is my original csdn above the blog, for various reasons, do not want to use CSDN blog, so the article moved to the present Cnblog.
Hello everyone, today I finally opened their own blog, very happy to share my learning experience with everyone, I hope we can progress together oh, nonsense not to say, look at me today to learn some of the problems and solutions Android
First the version of Eclipse I used was posted: adt-bundle-windows-x86-20130917 This is an integrated version that does not require configuration of the SDK and ADT, but requires manual configuration of the JDK!
In fact, different versions of Eclipse in the development of Android programs will be slightly different, let me start with the development of my Android program, I learned today is to pass data between two activity, below is my first activity, Is the interface used to calculate the multiplication of two numbers.
And here's my second activity.
The main purpose of the program is to display the results of the first activity in a second activity
but at the beginning my Android program code was
This is the main code in the first activity
The code for the second activity is
Edit without any errors, but run the program, the following interface appears
When you click the Calculate button, the following conditions occur:
Check for Logcat hints in eclipse
The reason for the error is probably that an activity parameter is not passed to the second activity, causing the second activity to receive a null parameter, and then cause the program to run an error, after its own careful check out, the program to make the following modifications :
The first activity program is modified as follows:
Make the following changes to the program in the second activity:
Run the program again to get the first and second correct results at the beginning
Analyze the reason:
when you invoke another activity in the activity , you need to call startactivity (Intent i), and if you need to pass the data while calling another activity, But in my version of Eclipse, I didn't pass the data correctly.
Workaround:
The ability to encapsulate data using a Android.os.Bundle object, passing data or parameters to pass through bundles to pass data between different intent
Data transfer between two activity in Android