foreground

How do i remove a foreground notification in Android Lollipop?

我怕爱的太早我们不能终老 提交于 2019-12-22 05:07:27
问题 I'm looking to stop/dismiss a foreground notification for a service for a mediaplayer, much similar to Google's implementation for Google Music. For instance in Google Music, if you are playing music then the the notification cannot be swiped away. However if you pause the music it can. This is completely different to how it is implemented on Android 4.4, where the notification starts only when you leave the app and removes itself when you go back into the app. I can't see how to implement

set foreground color in FrameLayout in android programmatically

风格不统一 提交于 2019-12-22 03:15:10
问题 I want to set foreground color in FrameLayout pragmatically (not in XML attribute). I have the color codes in RGB How can I convert color to drawable... frm.setForeground(Drawable); Help!! Thanks 回答1: You can create a Drawable from color: final int color = 0xFFFF0000; final Drawable drawable = new ColorDrawable(color); 回答2: Create Drawable from Color Using ContextCompat int color = R.color.black_trans_60; frm.setForeground(new ColorDrawable(ContextCompat.getColor(mContext, color))); Use

Phonegap 2.3.0 and the ForegroundCamera plugin

≡放荡痞女 提交于 2019-12-21 20:07:05
问题 I'm using Phonegap 2.3.0 and the new ForegroundCamera plugin from Google Code.. I followed the instructions carefully, and in my Eclipse setup I got the following errors when validating the project: Cannot cast from ForegroundCameraLauncher to Plugin ctx cannot be resolved or is not a field (x2) R cannot be resolved to a variable (x4) The method success(PluginResult, String) is undefined for the type ForegroundCameraLauncher Now, I solved the first three of the above errors by updating some

Issue when app coming back to foreground

社会主义新天地 提交于 2019-12-21 16:49:27
问题 my app crashes when it comes back to foreground after some time playing with others applications and I can't find out how to fix it. My app has a splash screen activity where it loads some data from web services and put it in global static variables declared in a class extending Application, as explained in this SO question. Once all data are loaded, this activity launches a Home activity with some menu to navigate in the app. The global vars are used in most activities. At some point, while

Change foreground color of textbox when text changes and meets certain criterion

限于喜欢 提交于 2019-12-21 05:06:33
问题 I require to set text color when text changes inside textbox and meets certain criterion. I can implement this from code behind with textbox_textchanged event and set brushes.color to desired color. But I am not being able to implement this with xaml wpf approach. I am new to wpf, I'm not sure how can I set text color depending upon certain criterion when text changes in textbox. For example: For a given textbox, when text changes, it needs to determine if input text is a number then change

Datagrid foreground colour not working

不想你离开。 提交于 2019-12-20 07:17:09
问题 I have a simple datagrid that display bidimensional data. I have tried it in a test project and the result is nice. Here is the xmal: <Grid > <DataGrid Name="dg" Margin="50" FontSize="26" CellEditEnding="dg_CellEditEnding" BeginningEdit="dg_BeginningEdit" LoadingRow="DataGrid_LoadingRow" EnableRowVirtualization="False" AutoGeneratingColumn="dg_AutoGeneratingColumn"/> </Grid> and the relevant event code: private void DataGrid_LoadingRow(object sender, System.Windows.Controls

WPF: How do I set the Foreground property of a TextBlock by TextBlock text value?

◇◆丶佛笑我妖孽 提交于 2019-12-20 03:09:28
问题 it’s possible set the foreground property of a TextBlock by TextBlock text value? For example: Text value is Mike, foreground property is Black, value is Tim, property value is green, etc. I search with google, but I don’t find any solution. 回答1: If you want the flexibility to do something smart, such as dynamically map texts to colors and so on, you could use a Converter class. I am assuming the text is set to bind to something, you could bind to the same something in Foreground but through

Bring to forward window when minimized

风格不统一 提交于 2019-12-17 20:35:51
问题 I want to know how to bring forward a particular window. SetForegroundWindow works when the window is not minimized!! but when a minimize the window, SetForegroundWindow doesn't work... this my code: int IdRemoto = int.Parse(textBoxID.Text); Process[] processlist = Process.GetProcessesByName("AA_v3.3"); foreach (Process process in processlist) { if (!String.IsNullOrEmpty(process.MainWindowTitle)) { if (IdRemoto.ToString() == process.MainWindowTitle) SetForegroundWindow(process

Foreground service being killed by Android

可紊 提交于 2019-12-17 02:03:42
问题 Update : I have not found a true solution to the problem. What I did come up with was a method of automatically reconnecting to a previous bluetooth device anytime the connection is lost. It's not ideal, but it seems to work fairly well. I'd love to hear any more suggestions regarding this though. I'm having much the same issue as in this question: Service being killed while holding wake lock and after calling startForeground including the device (Asus Transformer), the length of time before

JToggleButton - How to change the color?

房东的猫 提交于 2019-12-13 04:47:07
问题 I could to set the color of the button, but once the button is pressed its color is blue - standard. I want to be black. How do I change it? Below is the current code: public JPanel gameBoard(){ JPanel pBoard = new JPanel(); pBoard.setSize(5*horizontalOptions,5*verticalOptions); pBoard.setLayout(new GridLayout(horizontalOptions,verticalOptions)); jb = new JToggleButton[verticalOptions*horizontalOptions]; int k=0; for(int i=0;i<verticalOptions;i++){ for(int j=0;j<horizontalOptions;j++){ jb[k]