Monday, May 13, 2013

[General] help please!


hello guys, so i have an AT&T lg optimus g (E970) that's rooted, id like to apply the new jellybean update, but unfortunately i can't. i have removed some of the att bloatware just an fyi. any help on how to get this update would be great and much appreciated. thanks in advance



.

forum.xda-developers.com

[General] NovaLauncher Settings Contrast - Can't Read the Text!


I've been running NovaLauncher on my Nexus for a long time and love it, so when I got my Nook HD+ the first thing I did was load up NovaLauncher. I love it on the tablet, too, but when going into settings the right pane for settings has a tan/gray background with white lettering and I can't read the fine print. Anyone know how to change the background color?



.

forum.xda-developers.com

[General] Voicemail Notification


I have seen several other postings about this but none have worked for me.

I am coming from an iPhone to android. I love how Voicemail works on the iPhone. Whenever I get a Voicemail in my android phone the missed call notification comes up but no voicemail. When I can it though I have a new one. Under application settings for voicemail the notification is turned on. When I go into voicemail settings when I call it there is no option to turn notification on. Anybody have any ideas?

Sent from my VS930 4G using Android Central Forums



.

forum.xda-developers.com

[android help] data will not populate listview


I'm having issues populating my listview. I thought I had modifed my XML and adapters accordingly but apparently not. When the activity is loaded the dialog pops up stating it's loading then the app force closes. If i remove the 3 lines of coding stating listview.setText(name) then it just loads all the items with the default text in my XML file. My code looks like this:



import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.util.JsonReader;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;


public class DisplayServiceActivity extends ListActivity {
private ListView listOfServices;

//JSONArrays?
JSONArray directory;


//JSON Node names
private static String TAG_ID = "id";
private static String TAG_NAME= "name";
private static String TAG_DIRECTORY = "Categories";
private final static String url= "API LINK HERE";
JSONObject json;
jsonParser jParser = new jsonParser();
ArrayList> directoryList;

@SuppressLint("NewApi")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Request request = new Request();
request.execute();

listOfServices =getListView(); //get builtin listView


directoryList = new ArrayList>();

ListAdapter adapter = new SimpleAdapter(this,
directoryList,
R.layout.list_item,
new String[] { TAG_ID,TAG_NAME },
new int[] { android.R.id.text1,android.R.id.text2 });

setListAdapter(adapter);
setContentView(R.layout.service);
// Make sure we're running on Honeycomb or higher to use ActionBar APIs
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// Show the Up button in the action bar.
getActionBar().setDisplayHomeAsUpEnabled(true);
}
}// end of onCreate Method
@SuppressWarnings("unused")
public class Request extends AsyncTask {

private static final int REGISTRATION_TIMEOUT = 3 * 1000;
private static final int WAIT_TIMEOUT = 30 * 1000;
private ProgressDialog dialog =
new ProgressDialog(DisplayServiceActivity.this);


protected void onPreExecute() {
dialog = new ProgressDialog(DisplayServiceActivity.this);
dialog.setMessage("Getting your info real quick... Please wait...");
dialog.show();
}

protected JSONObject doInBackground(String... params) {

json = jParser.getJSONfromURL(url);

return json;

}

protected void onPostExecute(JSONObject s) {
super.onPostExecute(s);
String name = null;
String id = null;
dialog.dismiss();

try {
directory = s.getJSONArray("Categories");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for(int i = 0; i< directory.length(); i++){;
try {
id = directory.getJSONObject(i).getString(TAG_ID);
name = directory.getJSONObject(i).getString(TAG_NAME);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
displayCatList(id, name);

}

}

}

public void displayCatList(String id, String name){
//create new HashMap
HashMap map = new HashMap();

//add each child node to HashMap key
//map.put(TAG_ID, id);
map.put(TAG_NAME, name);

//adding HashList to ArrarList
directoryList.add(map);



// set Adapter for ListView here
ListAdapter adapter = new SimpleAdapter(this,
directoryList,
R.layout.list_item,
new String[] { id,name },
new int[] { android.R.id.text1,android.R.id.text2 });


TextView listName = (TextView) findViewById(R.id.listName);
Log.e("XML Variable", name);
listName.setText(name);

setListAdapter(adapter);

}



@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
}


List_item.xml





android:id="@+id/listName"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="rubble rubble rubble"
android:textColor="#FFFFFF"
android:padding="10dip"
android:textSize="20dip"
android:textStyle="bold" >



LogCat:



05-12 23:47:28.395: I/Adreno200-EGLSUB(4402): : Format RGBA_8888.
05-12 23:47:29.006: E/XML Variable(4402): Glass Repair
05-12 23:47:29.006: W/dalvikvm(4402): threadid=1: thread exiting with uncaught exception (group=0x416bf438)
05-12 23:47:29.006: E/AndroidRuntime(4402): FATAL EXCEPTION: main
05-12 23:47:29.006: E/AndroidRuntime(4402): java.lang.NullPointerException
05-12 23:47:29.006: E/AndroidRuntime(4402): at com.example.hstnc_activity.DisplayServiceActivity.displayCatList(DisplayServiceActivity.java:158)
05-12 23:47:29.006: E/AndroidRuntime(4402): at com.example.hstnc_activity.DisplayServiceActivity$Request.onPostExecute(DisplayServiceActivity.java:127)
05-12 23:47:29.006: E/AndroidRuntime(4402): at com.example.hstnc_activity.DisplayServiceActivity$Request.onPostExecute(DisplayServiceActivity.java:1)
05-12 23:47:29.006: E/AndroidRuntime(4402): at android.os.AsyncTask.finish(AsyncTask.java:631)
05-12 23:47:29.006: E/AndroidRuntime(4402): at android.os.AsyncTask.access$600(AsyncTask.java:177)
05-12 23:47:29.006: E/AndroidRuntime(4402): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
05-12 23:47:29.006: E/AndroidRuntime(4402): at android.os.Handler.dispatchMessage(Handler.java:99)
05-12 23:47:29.006: E/AndroidRuntime(4402): at android.os.Looper.loop(Looper.java:137)
05-12 23:47:29.006: E/AndroidRuntime(4402): at android.app.ActivityThread.main(ActivityThread.java:4918)
05-12 23:47:29.006: E/AndroidRuntime(4402): at java.lang.reflect.Method.invokeNative(Native Method)
05-12 23:47:29.006: E/AndroidRuntime(4402): at java.lang.reflect.Method.invoke(Method.java:511)
05-12 23:47:29.006: E/AndroidRuntime(4402): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
05-12 23:47:29.006: E/AndroidRuntime(4402): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
05-12 23:47:29.006: E/AndroidRuntime(4402): at dalvik.system.NativeStart.main(Native Method)


.

stackoverflow.comm

[android help] HelloWebViewClient cannot be resolved to a type

android - HelloWebViewClient cannot be resolved to a type - Stack Overflow








Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

















i followed a guide on http://developer.android.com/resources/tutorials/views/hello-webview.html and then created my own EditText field and a button. the code should explain it all, my problem is i keep getting a "HelloWebViewClient cannot be resolved to a type" Error, any suggestions? thanks in advance!



package com.text.text;
import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;

public class test extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.alt);
final EditText edittext = (EditText) findViewById(R.id.edittext);
final Button button = (Button) findViewById(R.id.okay);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Editable text = edittext.getText();
String Tekst = text.toString();
setContentView(R.layout.main);
WebView mWebView;
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl(Tekst);
mWebView.setWebViewClient(new HelloWebViewClient());
class HelloWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;

}
};
}
});
}}

























What if you put that class outside?



public class test extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.alt);
final EditText edittext = (EditText) findViewById(R.id.edittext);
final Button button = (Button) findViewById(R.id.okay);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Editable text = edittext.getText();
String Tekst = text.toString();
setContentView(R.layout.main);
WebView mWebView;
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl(Tekst);
mWebView.setWebViewClient(new HelloWebViewClient());
}
});
}

private class HelloWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}

}






















Change



mWebView = (WebView) findViewById(R.id.webview);


to



mWebView = (WebView) test.this.findViewById(R.id.webview);


Also, in Java class names should start with a capital letter.






















The problem is that you declare your class AFTER you use it. Move line mWebView.setWebViewClient(new HelloWebViewClient()); AFTER class declaration.























default







.

stackoverflow.comm

[android help] Cannot Disable Broadcast Receiver


I got the logic for disable/enable broadcast receiver from here.



@Override
public void onCheckedChanged(CompoundButton v, boolean checked) {
// TODO Auto-generated method stub

if (v == disableBlock) {
manageBlockSetting(checked);
}
}

private void manageBlockSetting(boolean disable) {
Log.e(tag, "Disable : " + disable);
int flag = disable ? PackageManager.COMPONENT_ENABLED_STATE_DISABLED
: PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
ComponentName component = new ComponentName(SettingActivity.this, PhoneCallReceiver.class);

getApplication().getPackageManager().setComponentEnabledSetting(component, flag, PackageManager.DONT_KILL_APP);
editSharedPreferences(StoreConstantValue.SETTING_DISABLE_BLOCK, disable);
}


And in Manifest.xml



android:enabled="true" >






When I deploy with android:enabled="false"


I can enable it once. But when I want to disable. Nothing happens, I can't disable it. It is still block incoming calls.


My device is Samsung Galaxy S2 with Android 2.3.3


Any help? Thanks



.

stackoverflow.comm

[android help] how to disable longclick for listview in android

how to disable longclick for listview in android - Stack Overflow








Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

















I want to disable the response to click and long click on items for a listview in android. I have set isEnabled(int position) of the adapter to return false, so that the cells in the listview does not response to click operation, but they still respond to long click operations(that is, they are highlighted when long clicked). the question is, what can I do to make the cells not highlighted when they are long clicked. Thank you.





























Set any background for your list item main layout.























Try setClickable instead of setEnabled




















default







.

stackoverflow.comm

[android help] How to make alert dialog appear only once when dragging the seek bar


Ok so i when i pull the seek bar the alert dialog freaks out and comes up multiple times on the avd. How do i fix it so that when there is no user input in the ETCash the alert Dialog shows up on the screen ONCE. This is keep on prompting the user invalid input until the user inputs something in the edittext that i created. Any suggestion!!! HAVE tried everything but with no avail !!



import java.text.DecimalFormat;

import junit.framework.Assert;
import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.TextView;

public class MainActivity extends Activity {



private SeekBar sbCash;
private Button btnten,btntwenty,btnthirty;
private TextView tvShwProg,tvfinal;
private EditText etCash;


@Override
public void onCreate(Bundle savedInstanceState)
{


super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

etCash = (EditText)findViewById(R.id.etCash);
sbCash = (SeekBar)findViewById(R.id.sbCash);
tvShwProg = (TextView)findViewById(R.id.tvShwProg);
tvfinal = (TextView)findViewById(R.id.tvFinal);
btnten = (Button)findViewById(R.id.btnten);
btntwenty = (Button)findViewById(R.id.btntwenty);
btnthirty = (Button)findViewById(R.id.btnthirty);




etCash.addTextChangedListener(new TextWatcher(){

public void afterTextChanged(Editable arg0)
{


}
public void beforeTextChanged(CharSequence arg0, int arg1,int arg2, int arg3)
{

}
public void onTextChanged(CharSequence arg0, int arg1, int arg2,int arg3) {

try{
guiChanged();
}
catch(Exception e)
{
e.printStackTrace();
AlertDialog alert =errormessage();
alert.show(); //<<< show AlertDialog here
}
}


});


SeekBar.OnSeekBarChangeListener sbListener = new SeekBar.OnSeekBarChangeListener()
{
public void onStopTrackingTouch(SeekBar seekBar) {

}

public void onStartTrackingTouch(SeekBar seekBar) {}
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
{
try{
guiChanged();
}
catch(Exception e)
{
e.printStackTrace();
}
}


};
sbCash.setOnSeekBarChangeListener(sbListener);

dosomethig();
dosomethig2();
dosomething3();




}

public AlertDialog errormessage()
{
// Use the Builder class for convenient dialog construction
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setMessage("Enter a Number!!!!")
.setNegativeButton("Fix", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// User cancelled the dialog
}
});
// Create the AlertDialog object and return it
return builder.show();
}


public void guiChanged()
{
try{
DecimalFormat fmt = new DecimalFormat ("0.00");

int CashMoney = sbCash.getProgress();

tvShwProg.setText("Current Percentage " +CashMoney+ "%");

double amount = Double.parseDouble(etCash.getText().toString());

double moneydue = (amount * (CashMoney/100.0));

double totalamount = (moneydue + amount);

tvfinal.setText("Tip " + fmt.format(moneydue)+ " Total "+ fmt.format(totalamount));
}
catch(Exception e)
{
e.printStackTrace();

AlertDialog alert = errormessage();
alert.show();
if(alert.isShowing())
{
alert.cancel();
}
}

}


public void dosomethig()
{

btnten.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub

sbCash.setProgress(10);


}
});
}
public void dosomethig2()
{

btntwenty.setOnClickListener(new View.OnClickListener()
{

@Override
public void onClick(View v) {
// TODO Auto-generated method stub

sbCash.setProgress(15);
}


});
}
public void dosomething3()
{
btnthirty.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub

sbCash.setProgress(20);

}
});
}


.

stackoverflow.comm

[android help] In iOS, are there something similar to Android ANR trace log?


As the title said, I am wondered that when an App is blocked and cannot respond to user interaction, can I get the Call Stack?


Thanks in advance. More info here: Any good ways to get useful information when the released App has no response to User Interaction?



.

stackoverflow.comm

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...