android


why text is texted wrongly in this method in android?


please help me! at first please follow this algorithm:
1- btn_set1 is clicked, its functions are doing.
2- btn_set2 is clicked, "text1" is SetText ed into "+"!!!
WHY???
please help me, how can i solve this problem? thanks.
public void onClick(View view) {
switch (view.getId()){
//time picker pannel
case R.id.btn_set1:
text1.setText(aTime);
intent1 = new Intent(this, alarmService.class);
intent1.putExtra("rq1", req_code);
intent1.putExtra("alarm_time", alarm_time1);
startService(intent1);
alinear.setAnimation(animLeft);
Linear.setVisibility(View.GONE);
text2.setVisibility(View.VISIBLE);
break;
case R.id.btn_set2:
text2.setText(aTime);
intent2 = new Intent(this, alarmService.class);
intent2.putExtra("rq2", req_code);
intent2.putExtra("alarm_time", alarm_time1);
startService(intent2);
LLinear.setAnimation(animLeft);
Linear.setVisibility(View.GONE);
case R.id.btn_cancle1:
Linear.setAnimation(animLeft);
Linear.setVisibility(View.GONE);
cancel_one(text1);
break;
case R.id.btn_cancle2:
Linear.setAnimation(animLeft);
Linear.setVisibility(View.GONE);
cancel_one(text2);
break;
}
}
private void cancel_one(TextView textView) {
if(intent1 != null)
stopService(intent1);
if(intent2 != null)
stopService(intent2);
textView.setText("+");
}
You forgot to put a break statement in the case 2: and hence case 3: also gets invoked called when case 2 is invoked

Related Links

sqlite timestamp
HTTP Request on Android crashes
Listview with Textview and 2 Edittext in a single row in android
Horizontal Carousel or ScrollView with text over image
Android: ListView Load gives Null Pointer Exception
Experiencing choppyness when loading Bitmaps into ImageViews from AsyncTask. Looking for improvement pointers
Why startActivityForResult doesn't use a callback or a higher level way for returning results?
Unfortunately (app name) has stopped
How can I create this UI navigation control?
Eclipse DDMS Network Statistics empty
App shows grid screen instead of google map
Sending wrong date value in mysql databse
Is it possible to block Outgoing SMS?
Android onPause thread freeze application
Android Day and date in String format
OpenCV: Convert char* to cv::Mat

Categories

HOME
grok
forms
pdfbox
aws-cli
parameters
nstableheaderview
computer-science
pattern-matching
openstreetmap
commonjs
reactive-programming
text-mining
rtf
naivebayes
plink
http-post
chargify
forgot-password
asp.net-mvc-viewmodel
enterprise-miner
drive
libigl
r-mice
event-store
interpreter
onload
maze
pic32
outliers
vex
volatile
paragraph
jmockit
wacom
linkedhashmap
installshield-le
cd
odroid
magento-1.9.3
congestion-control
avcapturedevice
optimizely
ntvs
automapper-5
user-defined-fields
manova
insight
azure-cli
java-bytecode-asm
cpu-cache
pybrain
gameplay-kit
baidu
stax
iotivity
mongodb-php
nikeplus-api
ng-grid
pre-build-event
uiactionsheet
toast
boomerang
java-money
iokit
fuelcms
evolus-pencil
iced-coffeescript
apache-commons-daemon
ansi
public-html
sql-scripts
build-script
mintty
jquery-slider
dct
dot42
square-bracket
android-audiorecord
spring-3
bin
gtm-oauth2
modular
flex++
time.h
composite-component
insert-id
bjyauthorize
booksleeve
robotlegs
panda3d
monotouch.dialog
pyunit
fusefabric
update-statement
massive
unattended-processing
cloudfiles
qglwidget
uideviceorientation
object-database
jqueryform
isapi-extension
wcf-proxy

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App