android-intent

Xamarin.Android Background task disposed after application closed

泪湿孤枕 提交于 2020-01-16 08:59:12
问题 Task: Create a background task to run when application is stopped/paused that periodically (3-7 seconds) performs HTTP requests and stores response information in mysqlite and displays local notifications when required. I have create a background service like the following, [Service(Enabled = true)] public class MyRequestService : Service That is started like an intent from MainActivity, public void StartMyRequestService() { var serviceToStart = new Intent(this, typeof(MyRequestService));

How can I make images disappear from a grid view on touch?

南楼画角 提交于 2020-01-16 08:44:10
问题 I have a grid view with various image views within it, and I want these images to disappear when touched. How can I do this? How can I implement a touch listener for these grid view images? 回答1: The ImageViews all are types of views and the layouts are ViewGroups. Any of these you can set the visibility to gone or removed. So really you just neeed to implement onTouchListener event handler and then set visibility on the ImageViews. So you might want to consider setting a whole layout to

Android stand alone service

旧时模样 提交于 2020-01-16 06:37:37
问题 I just started working on an application for Android, to be specific - a service. I would like to create a service (background service, forcing itself to run, hidden, so it can't be shut down). and I don't have idea on how to construct it. How it is then launched and how to make it fit to those requirements. It needs to start running from the Android start, so I guess it would be created similarly to system services (or as a system service). You may ask why I need that - I would like it to

Android - Custom action in Broadcast Intent

此生再无相见时 提交于 2020-01-16 06:07:34
问题 I am trying to allow user to post comment when he is offline such that whenever wifi/internet is turned on his comment will be posted.Fot that I am using BroadCastReceiver.But the issue i am having is that it is never going inside if (intent.getAction().equals("commentpost")) if i try switching on wifi after clicking on postcomment.However it does go inside if (wifi.isAvailable() || mobile.isAvailable()) whenever i switch on wifi.I failed to understand where i am going wrong.My log shows

Android - Custom action in Broadcast Intent

。_饼干妹妹 提交于 2020-01-16 06:06:16
问题 I am trying to allow user to post comment when he is offline such that whenever wifi/internet is turned on his comment will be posted.Fot that I am using BroadCastReceiver.But the issue i am having is that it is never going inside if (intent.getAction().equals("commentpost")) if i try switching on wifi after clicking on postcomment.However it does go inside if (wifi.isAvailable() || mobile.isAvailable()) whenever i switch on wifi.I failed to understand where i am going wrong.My log shows

Start intent service and close app

淺唱寂寞╮ 提交于 2020-01-16 04:11:06
问题 I'm implementing GCM in my app and I start the RegistrationIntentService in the main activity. What happens if I close the app before the intent finishes? The service takes a few seconds and I need the registration finishes despite the user has closed the app. This work this way or I have to do something more? Thanks! 回答1: Unless the system suddenly kills the application process, the intent will finish, because as a user you don't have direct control over when the app is actually closed

how to always save image with new name and delete previouse one (android)

荒凉一梦 提交于 2020-01-16 01:55:06
问题 i am working on a wallpaper app in which i am saving a image with same name and sending it to gallery intent. because of saving every image with same name i am having problem of getting same image every time in gallery intent. what happening is new image is replacing but i am getting older image in gallery intent. new image replace older image but still gallery intent shows older image instead of new image so i want to save image with new name every time but also delete older saved image.

App icon not visible in intent chooser in Android

社会主义新天地 提交于 2020-01-15 17:31:41
问题 i am opening an intent chooser to send a url Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, "Text to send"); sendIntent.setType("text/plain"); startActivity(Intent.createChooser(sendIntent, "Complete Action using..")); The issue is that the images for the apps are not visible. Please see the screenshot attached. 回答1: There are lot of questions asked on stackoverflow regarding this issue. The code i am using for showing list with icons in

App icon not visible in intent chooser in Android

被刻印的时光 ゝ 提交于 2020-01-15 17:31:11
问题 i am opening an intent chooser to send a url Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, "Text to send"); sendIntent.setType("text/plain"); startActivity(Intent.createChooser(sendIntent, "Complete Action using..")); The issue is that the images for the apps are not visible. Please see the screenshot attached. 回答1: There are lot of questions asked on stackoverflow regarding this issue. The code i am using for showing list with icons in

ActivityNotFoundException: Unable to find explicit activity class service

天大地大妈咪最大 提交于 2020-01-15 15:29:28
问题 This is how my MainActivity and RecorderService Java class files looks like. I'm adding the AndroidManifest file too. MainAcitivity.java protected void onCreate(Bundle savedInstanceState) { btnSendSOS.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sendSMS(); Intent intent = new Intent(getBaseContext(), RecorderService.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); finish(); new CountDownTimer(5000, 1000) { @Override