[Q] own global settings (Settings.System) - Android Q&A, Help & Troubleshooting

Hi all,
I am currently doing some changes to the CM7-Framework and therefore need a custom option.
I wrote a simple app to test it and it doesn't work. The app has 3 Buttons
turnOn, turnOff and check
and one TextView for output.
Clicking turnOn does:
Code:
boolean success = Settings.System.putInt(getContentResolver(), "USE_BUTTONS_ON_NOTIFICATON", 1);
textView1.setText("set USE_BUTTONS_ON_NOTIFICATION to 1, success: " + success);
Clicking turnOff does:
Code:
boolean success = Settings.System.putInt(getContentResolver(), "USE_BUTTONS_ON_NOTIFICATON", 0);
textView1.setText("set USE_BUTTONS_ON_NOTIFICATION to 0, success: " + success);
and check does:
Code:
try {
int value = Settings.System.getInt(getContentResolver(), "USE_BUTTONS_ON_NOTIFICATION");
textView1.setText("USE_BUTTONS_ON_NOTIFICATION is: " + value);
} catch (SettingNotFoundException e) {
textView1.setText("Setting not found");
e.printStackTrace();
}
Both buttons return true, but check always says that the option is 1.
Is it even possible to change Settings like this? The app has the WRITE_SETTINGS permission.
If it is not possible, what would be a good way to ìmplement an option set by an app and read by a class inside the framework?

Related

Ping app

hey guys,
Building an app that runs a ping command at the moment and I can't quite get it to work. If I modify the command to something that isn't a terminal command then it'll output my error statement but i can't get it to display the ping output. any help would be awesome. I know my outputs for my error are bad but it's an easy way to determine what path it's outputting.
package com.mycompany.myapp;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import java.io.*;
import java.lang.Process;
public class MainActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
TextView Text = new TextView(this);
Runtime runtime = Runtime.getRuntime();
try
{
Process proc = runtime.getRuntime().exec("system/bin/ping 192.168.1.1");
BufferedReader in = new BufferedReader(
new InputStreamReader(proc.getInputStream()));
String line = "null";
while ((line = in.readLine()) != null) {
Text.setText(in.readLine());
}
}
catch (Exception e)
{
String line="55";
Text.setText(line);
}
setContentView(Text);
}
}
Thanks for any help you guys can give me,
Adam
Hey,
Try using "system/bin/ping -c 1 192.168.1.1" instead.
And then add this line just after that:
Code:
proc.waitFor();
and while reading the output of the ping you might want to do it like this maybe?
Code:
String line = "";
String result = "";
while (line != null)
{
result = result + "\n" + line;
line = in.readLine();
}
Text.setText(result);
If you want to ping more than 1 packet I think it would be better to make a new thread and do proc.waitFor() in that thread. Then send a message using a handler to set the output of the ping to the TextView
k i have done that and that does make more sense but Im still getting a black screen on the output. i am testing on a Sony tab s and using AIDE (on the device) cause my eclipse is broken. this is how my code looks now,
package com.mycompany.myapp;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import java.io.*;
import java.lang.Process;
public class MainActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
TextView Text = new TextView(this);
Runtime runtime = Runtime.getRuntime();
try
{
Process proc = runtime.getRuntime().exec("system/bin/ping 192.168.1.1");
BufferedReader in = new BufferedReader(
new InputStreamReader(proc.getInputStream()));
String line = "null";
while ((line = in.readLine()) != null) {
Text.setText(in.readLine());
}
}
catch (Exception e)
{
String line="55";
Text.setText(line);
}
setContentView(Text);
}
}
Is there anything else I could be missing??
Thanks,
Adam
Hey, I think you posted the same code again.
I am not sure if you can read the process stream before it is complete and ping does take a long time to complete. So your main thread is blocking on it and it doesn't get to executing the setContentView.
Thats why I think going for a seperate thread is a better option.
so it would be better to put the ping into a new class and call on it when i need it??
Not a seperate class, a seperate thread to be more specific.
Even if you do put the ping code in a seperate class' method and call that method in onCreate it will still run on the your applications main thread.
What I was trying to say is something along the lines of the following code:
Code:
private TextView textView;
private Process process;
private Handler handler;
private Thread pingThread;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
textView = new TextView(this);
textView.setText("Pinging...");
setContentView(textView);
try
{
process = Runtime.getRuntime().exec("system/bin/ping -c 5 192.168.1.1");
handler = new Handler()
{
@Override
public void handleMessage(Message msg)
{
try
{
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = "";
String result = "";
while(line != null)
{
result = result + "\n" + line;
line = reader.readLine();
}
reader.close();
textView.setText(result);
}
catch(Exception e)
{
e.printStackTrace();
textView.setText("Error");
}
}
};
pingThread = new Thread()
{
@Override
public void run()
{
try
{
process.waitFor();
}
catch(Exception e)
{
e.printStackTrace();
}
handler.sendEmptyMessage(0);
}
};
pingThread.start();
} catch (Exception e)
{
e.printStackTrace();
}
}
I am not sure if this is exactly how you want your app to behave. There might be a better way of doing what you want than what I have suggested but I tested the above code and it works for me.
thats wicked, basically what want my program to do is to run a ping command through a usb to rj45 adapter. at the moment I just need it to do the ping command through wifi and once that was working I was going to set it up to go through usb.
I wonder if there's something I'm doing wrong like I'm build the apk in AIDE on the tablet or something, cause I'm still getting a black screen when booting the app.
If I error the code up a bit, Like put "system/bin/pi ....." instead I do get pinging on the app but no error output and if the code is fine then nothing displays
That is very strange :S.
If you use the incorrect command it works fine but when you use the correct command it doesn't?
Can you post your code? or provide more details if possible?
the code is just the code you posted cause I thought if a I could get it working with that code then modify it to what it needs to do, when the command is incorrect it displays "ping....." but doesn't display an error, I'm going to install eclipse and build the package with that and see how it goes. did you test on a tablet and what did you use to deploy the package?
Adz117 said:
the code is just the code you posted cause I thought if a I could get it working with that code then modify it to what it needs to do, when the command is incorrect it displays "ping....." but doesn't display an error, I'm going to install eclipse and build the package with that and see how it goes. did you test on a tablet and what did you use to deploy the package?
Click to expand...
Click to collapse
I think i know whats happening. It isnt the Ide and using eclipse wont make much of a difference.
Are you usIng something like -c 5 in the ping command? Cause if you aren't i think ping is Going to take a really long time and all you'll see on the screen is "Pinging..."
Yea I have got that in the command, when the code is correct and working I dont get anything all I get is a black screen. Its when I error the command up a bit that I get pinging
Sent from my Sony Tablet S using XDA
hey guys,
just got eclipse running and tested it on an avd emulator and it runs perfect, so the question is what would cause it not to run on my tablet?
I have no idea! I don't have access to an Android Tablet, so I can't test it out! I tested it out on my phone too and it works just fine.
One thing I can suggest though is:
Put log statements throughout the program to signify where the the control has reached. Then run it on your tablet. That should shed some light on where the code is failing on your tablet.
tested it on my phone which is running 2.3 and it failed on there as well, "ping......" would pop up for about a second then disappear, also if I use a command like ls instead of ping on my tablet it will work perfectly fine so I'm guessing for some reason past android 2.1 it doesn't like the ping command. any ideas?
I tested it out on phone with 2.2. Did you try putting log statements and checking where it is failing.
You could also add breakpoints in your code and run it?

[Q] GoogleMap resets and stops responding

Hi all..
I am not sure this is the right sub-forum to post in, but here goes.
I am working on an app that uses a GoogleMap and lots of overlays/markers. Controls and navigation is handled automatically (no direct user interaction with the map needed so far).
Things work the way I want right until the app pauses and goes into the background. When I resume the app the map has zoomed out to 0:0 and it doesn't react to animateMap or anything anymore. I can't seem to figure how I get it back to the state where it doesn't react to user interaction and actually updates with my markers and stuff..
Below are the three methods handling the map, and it doesn't seem to react on any of it after a resume. Any hints?
Code:
private void setupMap(){
getSupportFragmentManager().beginTransaction().replace(R.id.trackeractivity_map, new SupportMapFragment()).commit();
FragmentManager fragmentManager = getSupportFragmentManager();
SupportMapFragment supportMapFragment = (SupportMapFragment) fragmentManager.findFragmentById(R.id.trackeractivity_map);
mMap = supportMapFragment.getMap();
mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
mMap.setMyLocationEnabled(true);
Log.d(TAG, "Max zoom level " + mMap.getMaxZoomLevel());
}
private void updateUserLocation(double lat, double lon){
Log.d(TAG, "updateUserLocation - " + lat + " : " + lon);
mLastLocationLat = lat;
mLastLocationLon = lon;
CameraPosition userPos = new CameraPosition(new LatLng(lat, lon), mMap.getMaxZoomLevel()-4, 0, 0);
mMap.animateCamera(CameraUpdateFactory.newCameraPosition(userPos));
}
private void updateMapOverlay(double lat, double lon){
Log.d(TAG, "updateMapOverlay - " + lat + " : " + lon + " - Type " + mCurrentType);
MarkerOptions marker = new MarkerOptions();
marker.position(new LatLng(lat, lon));
marker.draggable(false);
marker.icon(BitmapDescriptorFactory.fromResource(getTypeDrawableID(mCurrentType)));
mMap.addMarker(marker);
}
Try to re flash Google apps package or restore any previous nandroid backup
FRIEND IF I HELPED YOU HIT THANKS
Androyash said:
Try to re flash Google apps package or restore any previous nandroid backup
FRIEND IF I HELPED YOU HIT THANKS
Click to expand...
Click to collapse
That, unfortunately, didn't help.. Still does the same thing.. Bugs the crap out of me..
Maybe it is just me, but how do i set UISettings on the map? There only seems to be a method to get them?
https://developers.google.com/maps/...erence/com/google/android/gms/maps/UiSettings

[XPOSED] [KK] [FIX] KitKat BUGS fixer

============== FIXES ==============
1. https://android-review.googlesource.com/#/c/81970/
Head: All service returning START_STICKY do not restart after it is being killed.
Symptom: if you will start heavy application (game, video encode/decode viewing or bad application which occupy lot of resources), android can kill background service, for example Skype or WhatsApp, but will never restart services when resources become free. Need to start application again or even full phone restart.
Affected version: 4.4, 4.4.1, and 4.4.2.
2. https://android-review.googlesource.com/#/c/98918/
Head: If all activities of a given stack were finishing, no activity was marked as front-of-task.
Symptom: if recents has several apps running, clicking BACK button fast to close current activity will bring to front another activity.
Affected version: 4.4.*
Mod does not have any settings activity. Just enabled it in Xposed menu.
INSTRUCTIONS:
if you get boot-loop
1. after phone start go to Xposed and immediately uncheck module.
2. issue command adb logcat > logcat.txt
3. phone will reboot again soon
4. upload logcat somewhere and post link here.
5. After next restart mod will be disabled.
6. Wait when I will publish correction.
Can be downloaded through Xposed Installer or here: http://repo.xposed.info/module/kz.virtex.android.issue63793fix
Source code:
Code:
package kz.virtex.android.issue63793fix;
import android.content.pm.ApplicationInfo;
import android.os.SystemClock;
import android.util.EventLog;
import android.util.Slog;
import com.android.server.am.EventLogTags;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.XC_MethodReplacement;
import de.robv.android.xposed.XposedHelpers;
public class XMain implements IXposedHookZygoteInit
{
@Override
public void initZygote(StartupParam startupParam) throws Throwable
{
final Class<?> ActiveServices = XposedHelpers.findClass("com.android.server.am.ActiveServices", null);
XposedHelpers.findAndHookMethod(ActiveServices, "killServicesLocked", "com.android.server.am.ProcessRecord", "boolean", new XC_MethodReplacement()
{
@Override
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable
{
Boolean DEBUG_SERVICE = (Boolean) XposedHelpers.getStaticBooleanField(ActiveServices, "DEBUG_SERVICE");
String TAG = (String) XposedHelpers.getStaticObjectField(ActiveServices, "TAG");
Object app = param.args[0];
boolean allowRestart = (Boolean) param.args[1];
Object services = XposedHelpers.getObjectField(app, "services");
int size = (Integer) XposedHelpers.callMethod(services, "size");
// First clear app state from services.
for (int i = size - 1; i >= 0; i--) {
Object sr = XposedHelpers.callMethod(services, "valueAt", i);
Object stats = XposedHelpers.getObjectField(sr, "stats");
synchronized (XposedHelpers.callMethod(stats, "getBatteryStats")) {
XposedHelpers.callMethod(stats, "stopLaunchedLocked");
}
Object sr_app = XposedHelpers.getObjectField(sr, "app");
Boolean persistent = XposedHelpers.getBooleanField(sr_app, "persistent");
Boolean stopIfKilled = XposedHelpers.getBooleanField(sr, "stopIfKilled");
if (sr_app != null && !persistent && stopIfKilled) {
Object sr_app_services = XposedHelpers.getObjectField(sr_app, "services");
XposedHelpers.callMethod(sr_app_services, "remove", sr);
}
XposedHelpers.setObjectField(sr, "app", null);
XposedHelpers.setObjectField(sr, "isolatedProc", null);
XposedHelpers.setObjectField(sr, "executeNesting", 0);
XposedHelpers.callMethod(sr, "forceClearTracker");
Object mDestroyingServices = XposedHelpers.getObjectField(param.thisObject, "mDestroyingServices");
Boolean check = (Boolean) XposedHelpers.callMethod(mDestroyingServices, "remove", sr);
if (check) {
if (DEBUG_SERVICE)
Slog.v(TAG, "killServices remove destroying " + sr);
}
Object bindings = XposedHelpers.getObjectField(sr, "bindings");
final int numClients = (Integer) XposedHelpers.callMethod(bindings, "size");
for (int bindingi = numClients - 1; bindingi >= 0; bindingi--) {
Object IntentBindRecord = XposedHelpers.callMethod(bindings, "valueAt", bindingi);
if (DEBUG_SERVICE)
Slog.v(TAG, "Killing binding " + IntentBindRecord + ": shouldUnbind=" + XposedHelpers.getObjectField(IntentBindRecord, "hasBound"));
XposedHelpers.setObjectField(IntentBindRecord, "binder", null);
XposedHelpers.setObjectField(IntentBindRecord, "requested", false);
XposedHelpers.setObjectField(IntentBindRecord, "received", false);
XposedHelpers.setObjectField(IntentBindRecord, "hasBound", false);
}
}
// Clean up any connections this application has to other
// services.
Object connections = XposedHelpers.getObjectField(app, "connections");
size = (Integer) XposedHelpers.callMethod(connections, "size");
for (int i = size - 1; i >= 0; i--) {
Object ConnectionRecord = XposedHelpers.callMethod(connections, "valueAt", i);
XposedHelpers.callMethod(param.thisObject, "removeConnectionLocked", ConnectionRecord, app, null);
}
XposedHelpers.callMethod(connections, "clear");
Object smap = XposedHelpers.callMethod(param.thisObject, "getServiceMap", XposedHelpers.getObjectField(app, "userId"));
// Now do remaining service cleanup.
services = XposedHelpers.getObjectField(app, "services");
size = (Integer) XposedHelpers.callMethod(services, "size");
for (int i = size - 1; i >= 0; i--) {
Object sr = XposedHelpers.callMethod(services, "valueAt", i);
Object mServicesByName = XposedHelpers.getObjectField(smap, "mServicesByName");
if (XposedHelpers.callMethod(mServicesByName, "get", XposedHelpers.getObjectField(sr, "name")) != sr) {
Object cur = XposedHelpers.callMethod(mServicesByName, "get", XposedHelpers.getObjectField(sr, "name"));
Slog.wtf(TAG, "Service " + sr + " in process " + app + " not same as in map: " + cur);
Object app_services = XposedHelpers.getObjectField(app, "services");
XposedHelpers.callMethod(app_services, "removeAt", i);
continue;
}
// Any services running in the application may need to be
// placed back in the pending list.
Object serviceInfo = XposedHelpers.getObjectField(sr, "serviceInfo");
Object applicationInfo = XposedHelpers.getObjectField(serviceInfo, "applicationInfo");
if (allowRestart && XposedHelpers.getIntField(sr, "crashCount") >= 2 && (XposedHelpers.getIntField(applicationInfo, "flags") & ApplicationInfo.FLAG_PERSISTENT) == 0) {
Slog.w(TAG, "Service crashed " + XposedHelpers.getIntField(sr, "crashCount") + " times, stopping: " + sr);
EventLog.writeEvent(EventLogTags.AM_SERVICE_CRASHED_TOO_MUCH, XposedHelpers.getObjectField(sr, "userId"), XposedHelpers.getObjectField(sr, "crashCount"), XposedHelpers.getObjectField(sr, "shortName"), XposedHelpers.getObjectField(app, "pid"));
XposedHelpers.callMethod(param.thisObject, "bringDownServiceLocked", sr);
} else if (!allowRestart) {
XposedHelpers.callMethod(param.thisObject, "bringDownServiceLocked", sr);
} else {
boolean canceled = (Boolean) XposedHelpers.callMethod(param.thisObject, "scheduleServiceRestartLocked", sr, true);
// Should the service remain running? Note that in the
// extreme case of so many attempts to deliver a command
// that it failed we also will stop it here.
if (XposedHelpers.getBooleanField(sr, "startRequested") && (XposedHelpers.getBooleanField(sr, "stopIfKilled") || canceled)) {
Object pendingStarts = XposedHelpers.getObjectField(sr, "pendingStarts");
if ((Integer) XposedHelpers.callMethod(pendingStarts, "size") == 0) {
XposedHelpers.setBooleanField(sr, "startRequested", false);
if (XposedHelpers.getObjectField(sr, "tracker") != null) {
Object tracker = XposedHelpers.getObjectField(sr, "tracker");
Object mAm = XposedHelpers.getObjectField(param.thisObject, "mAm");
Object mProcessStats = XposedHelpers.getObjectField(mAm, "mProcessStats");
XposedHelpers.callMethod(tracker, "setStarted", false, XposedHelpers.callMethod(mProcessStats, "getMemFactorLocked"), SystemClock.uptimeMillis());
}
if (!XposedHelpers.getBooleanField(sr, "hasAutoCreateConnections")) {
// Whoops, no reason to restart!
XposedHelpers.callMethod(param.thisObject, "bringDownServiceLocked", sr);
}
}
}
}
}
if (!allowRestart) {
Object app_services = XposedHelpers.getObjectField(app, "services");
XposedHelpers.callMethod(app_services, "clear");
// Make sure there are no more restarting services for this
// process.
Object mRestartingServices = XposedHelpers.getObjectField(param.thisObject, "mRestartingServices");
for (int i = (Integer) XposedHelpers.callMethod(mRestartingServices, "size") - 1; i >= 0; i--) {
Object r = XposedHelpers.callMethod(mRestartingServices, "get", i);
String processName = (String) XposedHelpers.getObjectField(r, "processName");
Object serviceInfo = XposedHelpers.getObjectField(r, "serviceInfo");
Object applicationInfo = XposedHelpers.getObjectField(serviceInfo, "applicationInfo");
Object info = XposedHelpers.getObjectField(app, "info");
if (processName.equals((String) XposedHelpers.getObjectField(app, "processName")) && XposedHelpers.getIntField(applicationInfo, "uid") == XposedHelpers.getIntField(info, "uid")) {
XposedHelpers.callMethod(mRestartingServices, "remove", i);
XposedHelpers.callMethod(param.thisObject, "clearRestartingIfNeededLocked", r);
}
}
Object mPendingServices = XposedHelpers.getObjectField(param.thisObject, "mPendingServices");
for (int i = (Integer) XposedHelpers.callMethod(mPendingServices, "size") - 1; i >= 0; i--) {
Object r = XposedHelpers.callMethod(mPendingServices, "get", i);
String processName = (String) XposedHelpers.getObjectField(r, "processName");
Object serviceInfo = XposedHelpers.getObjectField(r, "serviceInfo");
Object applicationInfo = XposedHelpers.getObjectField(serviceInfo, "applicationInfo");
Object info = XposedHelpers.getObjectField(app, "info");
if (processName.equals((String) XposedHelpers.getObjectField(app, "processName")) && XposedHelpers.getIntField(applicationInfo, "uid") == XposedHelpers.getIntField(info, "uid")) {
XposedHelpers.callMethod(mPendingServices, "remove", i);
}
}
}
// Make sure we have no more records on the stopping list.
Object mDestroyingServices = XposedHelpers.getObjectField(param.thisObject, "mDestroyingServices");
int i = (Integer) XposedHelpers.callMethod(mDestroyingServices, "size");
while (i > 0) {
i--;
Object sr = XposedHelpers.callMethod(mDestroyingServices, "get", i);
if (XposedHelpers.getObjectField(sr, "app") == app) {
XposedHelpers.callMethod(sr, "forceClearTracker");
XposedHelpers.callMethod(mDestroyingServices, "remove", i);
if (DEBUG_SERVICE)
Slog.v(TAG, "killServices remove destroying " + sr);
}
}
Object executingServices = XposedHelpers.getObjectField(app, "executingServices");
XposedHelpers.callMethod(executingServices, "clear");
return null;
}
});
}
}
Perfect. Good work.
Excellent! ^_^ We need more of your kind to fix goggles sloppy work...thanks!
chw9999 said:
Excellent! ^_^ We need more of your kind to fix goggles sloppy work...thanks!
Click to expand...
Click to collapse
just show and I will try )))
Awesome work!
Could you create a module for this fix also? https://android-review.googlesource.com/#/c/98918
a3Dman said:
Awesome work!
Could you create a module for this fix also? https://android-review.googlesource.com/#/c/98918
Click to expand...
Click to collapse
what if we will combine all bugs fixes in one mod?
Beautiful! I had this annoying issue with Skype.
Falseclock said:
what if we will combine all bugs fixes in one mod?
Click to expand...
Click to collapse
Fix working on my S5 Android 4.4.2
Thanks!
Sent from my SM-G900F using XDA Premium 4 mobile app
Hey there! Thank you! This module doesn't change the behaviour of the Google Play Music app when you swipe it from recents on my phone. I've installed it on my phone, and music still stops after clearing the app from recents.
Also, the last few comments on the Google Code issue tracker page say "This has been fixed in 4.4.3. Yay!" and "I just tested on 4.4.4, and can confirm that this appears to be fixed."...
But I'm running 4.4.4 on my Nexus 5, and Play Music still behaves that way. What gives? Any insight?
ZCochrane said:
But I'm running 4.4.4 on my Nexus 5, and Play Music still behaves that way. What gives? Any insight?
Click to expand...
Click to collapse
Affected version: 4.4, 4.4.1, and 4.4.2.
you do not need this mod.
Falseclock said:
Affected version: 4.4, 4.4.1, and 4.4.2.
you do not need this mod.
Click to expand...
Click to collapse
But that's what I'm saying, 4.4.4 is also affected, with Google Play Music behaving in the abnormal way you described.
ZCochrane said:
But that's what I'm saying, 4.4.4 is also affected, with Google Play Music behaving in the abnormal way you described.
Click to expand...
Click to collapse
yep, sorry. this is another issue
and related to 4.4.4
looking for solution
Falseclock said:
yep, sorry. this is another issue
and related to 4.4.4
looking for solution
Click to expand...
Click to collapse
Ooh, cool, gotcha!
Thanks!
ZCochrane said:
Ooh, cool, gotcha!
Thanks!
Click to expand...
Click to collapse
https://android-review.googlesource.com/#/c/53871/
will try to fix... too much coding (((
725 lines of code... looks almost impossible
a3Dman said:
Awesome work!
Could you create a module for this fix also? https://android-review.googlesource.com/#/c/98918
Click to expand...
Click to collapse
tonight :good:
Is HTC Sense 5.5 with Android 4.4.2 also affected?
[size=-2]Send with much love & Android. ( HTC One M7 )[/size]
n0j0e said:
Is HTC Sense 5.5 with Android 4.4.2 also affected?
Click to expand...
Click to collapse
yes
ZCochrane said:
Ooh, cool, gotcha!
Thanks!
Click to expand...
Click to collapse
on HTC 4.4.2 this bug already fixed so can't check by myself
please try with Google Music.
if you will get boot-loop - see OP
Falseclock said:
on HTC 4.4.2 this bug already fixed so can't check by myself
please try with Google Music.
if you will get boot-loop - see OP
Click to expand...
Click to collapse
That almost did it!! You're on the right track though, amazing!!
Now this happens:
1) Open Music & start song playback
2) Open recents, swipe Music away, then tap Home button.
3) Music keeps playing! (YAY!)
4) Open music app again, but do nothing in it. (Notification icon is removed, but the notification icon was never displayed when the app is open, so it's normal behaviour)
5) Tap Recent Tasks, music stops instantly, even without swiping the app away, notification icon stays gone.
6) (interestingly, at this stage, tapping the app's recent thumbnail doesn't open the app, nor does the Back button)
Problem is a step 5.
It's pretty cool to see this problem get attention, though.

ADB Tools with C#

Hello XDA,
I am writing ADB TOOLs in C# but having a problem with PATH recognition
Code:
private void button6_Click(object sender, EventArgs e)
{
openFileDialog1.InitialDirectory = @"C:\";
openFileDialog1.Title = "Select Kernel File";
openFileDialog1.FileName = "Choose File";
openFileDialog1.CheckFileExists = true;
openFileDialog1.CheckFileExists = true;
openFileDialog1.Filter = ".IMG|*.img";
if (openFileDialog1 .ShowDialog () == DialogResult .OK)
{
label1.Text = openFileDialog1 .FileName;
var process = Process.Start("CMD.exe", "/c fastboot flash boot " [COLOR="Red"]+ textBox2.Text[/COLOR] );
process.WaitForExit();
}
The red marked code has a problem i think, when i select a kernel image file located inside multiple directory to flash the CMD opens and just closes in a second nothing actually happens in a phone but when i use a file from a desktop it flashes w/o any problem.
I tried using path.combine( ) but really don't know how to use it, just started writing things in C#.
Thanks!
Bump!:fingers-crossed:
Bump Bump:crying:

[Q] How to change date text in dropdown statusbar on LP

on 4.4 and earlier android. I use
Code:
findAndHookMethod("com.android.systemui.statusbar.policy.DateView", lpparam.classLoader, "updateClock" new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param){
mDateView = (TextView) param.thisObject;
mDateView.setText("Hello");
}
});
to change the date text(e.g "December 1" to "Hello").
The class name and function name should be hooked are not changed, but this method not works on LP.
I'm trying to find another way to make it but failed. I'm not good at programming, so I need your help!

Categories

Resources