android-event

Android Calendar timezone not changing with CalendarContract

扶醉桌前 提交于 2019-12-23 01:51:17
问题 I am using the following code to add an event to the calender Intent intent = new Intent(Intent.ACTION_INSERT); intent.setType("vnd.android.cursor.item/event"); intent.putExtra(Events.TITLE, "my event title"); intent.putExtra(Events.EVENT_LOCATION, "my city"); intent.putExtra(Events.DESCRIPTION, "description of this event"); intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, dep.getTimeInMillis()); intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, arr.getTimeInMillis()); intent

Android EditText onClick Listener defined in Layout fails with obscure Exception

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 14:49:30
问题 I want to define an onClick Listener for an EditText in the Layout-XML of may activity, but it always fails with an obscure Exception. The Layout is injected with setContentView() in the onCreate -Method of my activity. I am not using a Fragment here and I am well aware that the XML defined onClick Listener do not work for fragments. For testing purposes I added the same handler method to an ImageView that is located next to the EditText. There the handler works, on the EditText it fails. So

Android get value of the selected radio button

久未见 提交于 2019-12-17 10:59:30
问题 I have a RadioGroup rg1 and I want to get the value of the selected radio button. I know that I can get the id of the selected radio button by using: if(rg1.getCheckedRadioButtonId()!=-1) int id= rg1.getCheckedRadioButtonId() that gives me the id , but I want the value of that button. 回答1: You need to get the radio button at that index, then get the value of the text of that button. Try this code below. if(rg1.getCheckedRadioButtonId()!=-1){ int id= rg1.getCheckedRadioButtonId(); View

Android change time of countDownTimer

♀尐吖头ヾ 提交于 2019-12-14 02:36:38
问题 my application is questioning/answering application, client/server, the client is android application, and the server is java tomcat server application i want the user to answer any question in 25 seconds, but i will give him time to read the question, that time depends on the number of words the question has, for example if the question has 10 words i will give him 10 seconds to read the question and then 25 seconds to answer, for sure the user who answers the question in 10seconds(of the 25

Android Touch UP not working

拜拜、爱过 提交于 2019-12-12 14:50:58
问题 im kinda stuck with this project in android im trying to figure out why this is not working but i have no idea.This is By the way a custom view just in case. The problem is this the event ACTION_DOWN is working perfectly im getting the console debug "Touching 1" and "Touching 2" but ACTION_UP,ACTION_CANCEL or default: are not working i cant figure this out so any help would be really appreciated thank you public void doTouch(MotionEvent event) { int action = event.getAction(); float x = event

android - overriding back button causes volume buttons stop working

给你一囗甜甜゛ 提交于 2019-12-12 01:58:46
问题 I'm trying to override Back button to stop an audio player and close media player activity, but I noticed that volume buttons are not working anymore. I imagine there is a mistake in overriding code. PS. in my MediaController I override hide() method to always show controls. mediaController = new MediaController(this) { @Override public void hide() { // TODO Auto-generated method stub //do nothing } @Override public boolean dispatchKeyEvent(KeyEvent event) { if(event.getKeyCode() == KeyEvent

Android send data from activity to activity using bundle

霸气de小男生 提交于 2019-12-11 03:31:39
问题 i have to activities AnswerQuestion.java and SendAnswerToServer.java , and i want to send data from first activity to another one on the AnswerQuestion activity i write this: Bundle basket = new Bundle(); basket.putString("time", timeToAnswer+""); Intent goToSendServer = new Intent(AnswerQuestion.this, SendAnswerToServer.class); goToSendServer.putExtras(basket); startActivity(goToSendServer); my question what have i to write on the SendAnswerToServer activity , thank you 回答1: in

Mono for Android OnPause event not triggering on Galaxy Nexus

家住魔仙堡 提交于 2019-12-10 18:31:00
问题 I put together my first Mono for Android project (targeting API level 8, minimum Android 2.2) and deployed it to an HTC Incredible [1] running 2.3.4. Everything worked great and breakpoints in my main activities OnCreate , OnStart , OnResume , OnPause , and OnStop all triggered as described on Xamarin's Activity Lifecycle tutorial. Without changing any project settings, I swapped for a Samsung Galaxy Nexus running 4.0.2 and deployed the same app. It called OnCreate just fine, but never

How to enable Drag a Marker (Android Map Api v2) after a single Touch?

自作多情 提交于 2019-12-10 17:23:46
问题 I have a map with some markers. I set the listener for drag: map.setOnMarkerDragListener(this); But the drag is enable only after the user long press the marker. I want to enable drag immediately. Is there a way to do this with Android Maps (v2)? 回答1: You can use Drag and Drop, with the Android drag/drop framework, you can allow your users to move data from one View to another view in the current layout using a graphical drag and drop gesture. The framework includes a drag event class, drag

How can I detect a fling gesture when there are widgets involved?

三世轮回 提交于 2019-12-08 10:11:49
问题 Background: I'm trying to detect edge swipes in my app (to bring up a menu), and searching stackoverflow seems to indicate that the way to detect swipes is to start with fling detection. I'm trying to detect a fling event in my app. I can override dispatchTouchEvent() or onTouchEvent() and pass the event to a gesture listener and everything works as you would expect. However, my app has button widgets in it and I can't both detect the fling and use the widgets. If I call the gesture detector