Read a browser layout with Android App - Java for Android App Development

Hi
Currently I am busy with development for my app. This app is supposed to read a website and give me back information from website. Unfortunately the site gives me back with all html/php code and this is difficult to remove the code before I display content on the app. How do I display a website without displaying php data?
Sent from my MT27i using xda app-developers app

Mphidi said:
Hi
Currently I am busy with development for my app. This app is supposed to read a website and give me back information from website. Unfortunately the site gives me back with all html/php code and this is difficult to remove the code before I display content on the app. How do I display a website without displaying php data?
Sent from my MT27i using xda app-developers app
Click to expand...
Click to collapse
I'm still a beginner, Why not you use webview if you want to display it as a webpage itself?
Code:
WebView wv = new WebView(context);
wv.setBackgroundColor(1);
wv.setBackgroundResource(color.transparent);
wv.loadUrl(URL);
wv.setWebViewClient(new WebViewClient() {
[user=439709]@override[/user]
public boolean shouldOverrideUrlLoading(WebView view,
String url) {
view.loadUrl(url);
return true;
}
//this method will clear cache everytime after loading the page.Set it to flase if you dont want it.
[user=439709]@override[/user]
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
view.clearCache(true);
}
});
and a variable
Code:
private static String URL = "http://www.example.com/example.html";

Thanks I will test it
Sent from my MT27i using xda app-developers app

Related

Question about parameters.

sendMessage (View view) {
}
The second lowercase "view" never gets referred to in the code written around it, I am actually reading the tutorials from google and am very frustrated because I cant figure this out...
Sent from my SPH-L900 using xda app-developers app
JamesChilds said:
sendMessage (View view) {
}
The second lowercase "view" never gets referred to in the code written around it, I am actually reading the tutorials from google and am very frustrated because I cant figure this out...
Sent from my SPH-L900 using xda app-developers app
Click to expand...
Click to collapse
You did not specify the type of the returned value:
These should work:
Code:
void sendMessage (View view) {
}
Code:
boolean sendMessage (View view) {
}
It is void. I understand it works but I dont know why? And I would rather know why before I continue learning.
Sent from my SPH-L900 using Tapatalk 4 Beta
The view is needed if you use androidnClick in a certain XML layout file. Without View view, you won't be able to use the method with onClick. You can remove the View view part if you don't use it with onClick. If you don't use it, it isn't necessary.
Sent from my awesome fridge
What makes it necessary? What I'm asking for is an explanation of the prupose of the lowercase view.
Sent from my SPH-L900 using Tapatalk 4 Beta
Could you possibly share a link to where you found this tutorial/code?
I'm not sure of your programming experience, so forgive me if I 'simplify' things too much.
Code:
sendMessage (View view)
The method signature defines a method called sendMessage which requires a View to be passed in.
View is the name of the Android class. The 'lowercase view' is the object, or instance, of View being passed in. You could essentially rename it if it helps:
Code:
sendMessage (View myview)
The purpose of including the view object is to manipulate it (get/set its properties). It would be done as so:
Code:
sendMessage (View myview) {
int height = myview.getHeight();
int id = getId();
//and so on
}
If the view object is not being used inside the method body, you could remove it from the signature.
Code:
sendMessage () {
//Code that doesn't need view
}
Hope that helps!
That is what I thought it meant. Now it doesn't necesarily have to be referred to or manipulated does it? As the examples im learning from don't.
Sent from my SPH-L900 using Tapatalk 4 Beta
Alkonic said:
Could you possibly share a link to where you found this tutorial/code?]
http://developer.android.com/training/basics/firstapp/starting-activity.html
Sent from my SPH-L900 using Tapatalk 4 Beta
Click to expand...
Click to collapse
JamesChilds said:
Alkonic said:
Could you possibly share a link to where you found this tutorial/code?]
http://developer.android.com/training/basics/firstapp/starting-activity.html
Sent from my SPH-L900 using Tapatalk 4 Beta
Click to expand...
Click to collapse
This code snippet now makes much more sense. What the tutorial is trying to do is listen for a button click - Android gives you two ways to do this: through XML or Java.
In Java:
Code:
Button myButton = (Button) findViewById(R.id.button1);
myButton.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
//Handle the click here.
}
});
In XML
Code:
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send"
android:onClick="sendMessage" />
Code:
/** Called when the user clicks the Send button */
public void sendMessage(View view) {
// Do something in response to button
}
Both these snippets do the same thing: register a method to receive click events.
When you do this in Java, you manually implement an OnClickListener and you're forced to override the onClick(View v) method.
When you specify the sendMessage in XML, Android assumes that you've created it with the correct signature: sendMessage(View myView)
Even if you don't use the view, you have to include it in your method signature: If you remove the view, and just use sendMessage(), your clicks won't work.
I prefer setting the click listeners in Java - it's simpler.
Click to expand...
Click to collapse
Thank you ;] all posts where very helpful.
Sorry I did not thank before
Sent from my SPH-L900 using Tapatalk 4 Beta

Battery_Voice_Indicator

I want to develop an app that can speak up my battery percentage whenever it decreases every 10%. Also, i want the JARVIS type voice notification. I am currently using galaxy fit operating on gingerbread 2.3.6 (dxkt7). Please help me with coding as i am new to app development. A similar application if provided, will be highly helpful.
Jasveen Singh said:
I want to develop an app that can speak up my battery percentage whenever it decreases every 10%. Also, i want the JARVIS type voice notification. I am currently using galaxy fit operating on gingerbread 2.3.6 (dxkt7). Please help me with coding as i am new to app development. A similar application if provided, will be highly helpful.
Click to expand...
Click to collapse
You can get the battery percentage and display it on a textview with this code:
Code:
private TextView contentTxt;
private BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver(){
[user=439709]@override[/user]
public void onReceive(Context arg0, Intent intent) {
// TODO Auto-generated method stub
int level = intent.getIntExtra("level", 0);
contentTxt.setText(String.valueOf(level) + "%");
}
};
[user=439709]@override[/user]
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
contentTxt = (TextView) this.findViewById(R.id.monospaceTxt);
this.registerReceiver(this.mBatInfoReceiver,
new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
}
Later, you can apply your own math skills to calculate if its multiples of 10 (Hint: easy would be to divide with 10 and check if reminder is 0).If it is, then you can pass on the string to android's native TTS class (Text To Speach) to synthesize the voice
Code:
public void speak (String string){
TTS = new TextToSpeech(this, this);
TTS.speak(string, TextToSpeech.QUEUE_FLUSH, null);
}
You want to register a service too.
vijai2011 said:
You can get the battery percentage and display it on a textview with this code:
Code:
private TextView contentTxt;
private BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver(){
[user=439709]@override[/user]
public void onReceive(Context arg0, Intent intent) {
// TODO Auto-generated method stub
int level = intent.getIntExtra("level", 0);
contentTxt.setText(String.valueOf(level) + "%");
}
};
[user=439709]@override[/user]
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
contentTxt = (TextView) this.findViewById(R.id.monospaceTxt);
this.registerReceiver(this.mBatInfoReceiver,
new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
}
Later, you can apply your own math skills to calculate if its multiples of 10 (Hint: easy would be to divide with 10 and check if reminder is 0).If it is, then you can pass on the string to android's native TTS class (Text To Speach) to synthesize the voice
Code:
public void speak (String string){
TTS = new TextToSpeech(this, this);
TTS.speak(string, TextToSpeech.QUEUE_FLUSH, null);
}
You want to register a service too.
Click to expand...
Click to collapse
Thank you sir. what is meant by registering a service. Sir it would be very helpful if you can guide me completely. I am new to java too.
Jasveen Singh said:
Thank you sir. what is meant by registering a service. Sir it would be very helpful if you can guide me completely. I am new to java too.
Click to expand...
Click to collapse
Service lets you have your activity run in background irrespective of your UI activity. You can make a service by extends service and declare it explicitly in manifest with this:
Code:
<service android:enabled="true"
android:name=".ServiceActivityName"/>
Or you can also make changes to code to register for broadcast receive on battery state change and completely avoid using service. Also later would be less work on light on resources IMO.
P.S: Just a note that you cannot register for batter change in manifest but have to explicitly register in java. Source
Thank you Sir. Sir it would be very helpful if you can provide me with the complete code from starting to end. Also, please guide me where to include this code i.e. in which file .src file or manifest file. Sir i am using ADT bundle for app development. Also, i am from non computer science background, so don't know java. Please guide me from starting to end. Sir, will the battery percentage be shown in icon. It would be nice if the battery percentage is displayed like samsung running jellybean i.e. the percentage besides the battery icon.
Currently using:
Samsung galaxy fit
os: gingerbread 2.3.6 dxkt7
Jasveen Singh said:
Thank you Sir. Sir it would be very helpful if you can provide me with the complete code from starting to end. Also, please guide me where to include this code i.e. in which file .src file or manifest file. Sir i am using ADT bundle for app development. Also, i am from non computer science background, so don't know java. Please guide me from starting to end. Sir, will the battery percentage be shown in icon. It would be nice if the battery percentage is displayed like samsung running jellybean i.e. the percentage besides the battery icon.
Currently using:
Samsung galaxy fit
os: gingerbread 2.3.6 dxkt7
Click to expand...
Click to collapse
Well....if you don't know java, you either have to learn java and then android app development (easy after learning java) or hire a developer for a fee to make the app for you.
Sent from my GT-N7000 using xda app-developers app

[Q]need help to make an xposed module

I am trying to make an xposed module(private use) to implement clear all button(ImageView) in recents.
Here is my code
Code:
package com.mycompany.myapp3;
import android.graphics.*;
import android.view.*;
import android.widget.*;
import de.robv.android.xposed.*;
import de.*;
import de.robv.android.xposed.callbacks.*;
import de.robv.android.xposed.callbacks.XC_LoadPackage.*;
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
public class MainActivity implements IXposedHookLoadPackage
{ImageView m;
String rc="com.android.systemui.recent.RecentsPanelView";
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable
{
findAndHookMethod(rc, lpparam.classLoader, "updateClock", new XC_MethodHook() {
@Override
protected void afterHookedMethod(final MethodHookParam param) throws Throwable
{
m.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{
ViewGroup mRecentsContainer = (ViewGroup) XposedHelpers.getObjectField(
param.thisObject, "mRecentsContainer");
// passing null parameter in this case is our action flag to remove all views
mRecentsContainer.removeViewInLayout(null);
}
});
}
});
}}
Now the problem is that i have already that ImageView in recent_panel.xml with no action assigned.i know its id and want to implement onclick action to that ImageView only by using its id.so what code should i add so that code recognises that ImageView and assigns it the above onclick action
Sent from my GT-S5570 using XDA Premium 4 mobile app
It's only an idea and maybe it doesn't solve your problem: Have you tried to hook onCreate and use the this-Object to call findViewById?
And you are making a mistake: You have to look, whether the loaded package is your specific package you want to hook. You try to hook every app.
Regards
EmptinessFiller said:
It's only an idea and maybe it doesn't solve your problem: Have you tried to hook onCreate and use the this-Object to call findViewById?
And you are making a mistake: You have to look, whether the loaded package is your specific package you want to hook. You try to hook every app.
Regards
Click to expand...
Click to collapse
1. this-object.?Can you give an example?
2.yes you are right i will fix it
Sent from my GT-S5570 using XDA Premium 4 mobile app
Sth. like m = (ImageView) ((Activity) param.thisObject).findViewById(id);
(Not tested)
EmptinessFiller said:
Sth. like m = (ImageView) ((Activity) param.thisObject).findViewById(id);
(Not tested)
Click to expand...
Click to collapse
I have got the solution already.thanks for your help
Sent from my GT-S5570 using XDA Premium 4 mobile app

[Q]Service doesn't stop even after calling stopService

Here is the service
Code:
public class SearchService extends IntentService {
public SearchService() {
super("SearchService");
// TODO Auto-generated constructor stub
}
// Binder given to clients
/**
* Class used for the client Binder. Because we know this service always
* runs in the same process as its clients, we don't need to deal with IPC.
*/
[user=439709]@override[/user]
protected void onHandleIntent(Intent intent) {
// TODO Auto-generated method stub
String FILENAME=intent.getStringExtra("name");
String FILEPATH=intent.getStringExtra("path");
ArrayList a=getSearchResult(new File(FILEPATH),FILENAME);
Toast.makeText(this, "Search Completed", Toast.LENGTH_LONG).show();
publishResults(a);
this.stopSelf();
}
private void publishResults(ArrayList<File> outputPath) {
Intent intent = new Intent("notify");
ArrayList<String> a=new ArrayList<String>();
for(int i=0;i<outputPath.size();i++){a.add(outputPath.get(i).getPath());}
intent.putStringArrayListExtra("path", a);
sendBroadcast(intent);
} private void publishResults(String a) {
Intent intent = new Intent("current");
intent.putExtra("name", a);
sendBroadcast(intent);
}}
I am using it like this
Code:
final Intent intent = new Intent(getActivity(), SearchService.class);
intent.putExtra("path",fpath);
intent.putExtra("name",a);
p=new ProgressDialog(getActivity());
p.setCancelable(false);
p.setTitle("Searching Files");
p.setMessage("Please Wait");
p.getWindow().addFlags( WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON );
p.setButton("Cancel", new DialogInterface.OnClickListener(){
public void onClick(DialogInterface p1, int p2)
{
getActivity().stopService(new Intent(getActivity(),SearchService.class));
// TODO: Implement this method
}
});
p.show();
getActivity().startService(intent);
but even after pressing cancel button,broadcast is received in activity
Sent from my GT-S5570 using XDA Premium 4 mobile app
A service to display a toast and brodcast the data it recieved looks like a design flaw
anyways you are extending the intent service i guess it does not implement stopService() rather it stops automatically when it has nothing to do[not sure with it please check documentation for IntentService never actually used one of those ]
I guess you need to extend the Service class from package android.app
Sent from my GT-S5302 using Tapatalk 2
sak-venom1997 said:
A service to display a toast and brodcast the data it recieved looks like a design flaw
anyways you are extending the intent service i guess it does not implement stopService() rather it stops automatically when it has nothing to do[not sure with it please check documentation for IntentService never actually used one of those ]
I guess you need to extend the Service class from package android.app
Sent from my GT-S5302 using Tapatalk 2
Click to expand...
Click to collapse
Actually I am using toast just for debugging.I am learning services. so I might be wrong at places.I made this service to search for files while an indeterminate progress dialog shows in activity till the broadcast of result is received.
I used intentservice because it was supposed to do one work at a time.please suggest me exact ways to use service in my case.I also want to make sure that if activity is paused(minimized) then, when task is completed activity is also started
Sent from my GT-S5570 using XDA Premium 4 mobile app
arpitkh96 said:
Actually I am using toast just for debugging.I am learning services. so I might be wrong at places. I made this service to search for files while an indeterminate progress dialog shows in activity till the broadcast of result is received.
I used intentservice because it was supposed to do one work at a time.please suggest me exact ways to use service in my case.I also want to make sure that if activity is paused(minimized) then, when task is completed activity is also started
Click to expand...
Click to collapse
You can still use an IntentService to do that. To stop it just pass an Intent to it with a boolean extra indicating that you don't want to do anything. You'll need only one more if clause in the onHandleIntent of the service.
SimplicityApks said:
You can still use an IntentService to do that. To stop it just pass an Intent to it with a boolean extra indicating that you don't want to do anything. You'll need only one more if clause in the onHandleIntent of the service.
Click to expand...
Click to collapse
That didnt worked I used it like this.
Code:
@Override
protected void onHandleIntent(Intent intent) {
// TODO Auto-generated method stub
String FILENAME=intent.getStringExtra("name");
String FILEPATH=intent.getStringExtra("path");
boolean b=intent.getBooleanExtra("run",false);
while(b){
ArrayList<File> a=getSearchResult(new File(FILEPATH),FILENAME);
publishResults(a);
this.stopSelf();}
}
Code:
final Intent intent = new Intent(getActivity(), SearchService.class);
intent.putExtra("path",fpath);
intent.putExtra("name",a);
intent.putExtra("run",true);
p=new ProgressDialog(getActivity());
p.setCancelable(false);
p.setTitle("Searching Files");
p.setMessage("Please Wait");
p.getWindow().addFlags( WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON );
p.setButton("Cancel", new DialogInterface.OnClickListener(){
public void onClick(DialogInterface p1, int p2)
{
Intent j=new Intent(getActivity(),SearchService.class);
j.putExtra("run",false);
getActivity().stopService(j);
// TODO: Implement this method
}
});
p.show();
getActivity().startService(intent);
Sent from my GT-S5570 using XDA Premium 4 mobile app
arpitkh96 said:
That didnt worked I used it like this.
Code:
@Override
protected void onHandleIntent(Intent intent) {
// TODO Auto-generated method stub
String FILENAME=intent.getStringExtra("name");
String FILEPATH=intent.getStringExtra("path");
boolean b=intent.getBooleanExtra("run",false);
while(b){
ArrayList<File> a=getSearchResult(new File(FILEPATH),FILENAME);
publishResults(a);
this.stopSelf();}
}
Code:
final Intent intent = new Intent(getActivity(), SearchService.class);
intent.putExtra("path",fpath);
intent.putExtra("name",a);
intent.putExtra("run",true);
p=new ProgressDialog(getActivity());
p.setCancelable(false);
p.setTitle("Searching Files");
p.setMessage("Please Wait");
p.getWindow().addFlags( WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON );
p.setButton("Cancel", new DialogInterface.OnClickListener(){
public void onClick(DialogInterface p1, int p2)
{
Intent j=new Intent(getActivity(),SearchService.class);
j.putExtra("run",false);
getActivity().stopService(j);
// TODO: Implement this method
}
});
p.show();
getActivity().startService(intent);
Click to expand...
Click to collapse
First, if you look in the Dokumentation for IntentService, it says that you should not call stopSelf because it is already implemented to do that when there are no intents left. So It really should be easier to use a Service if you want to stop it like that.
If you want to keep using the intent service, I'd instead use a boolean instance variable which is checked in the publishResults method so just let the service do its work, but before it is published in the UI thread check if the dialog was canceled or not. Otherwise because you have two threads you can't be sure when the other thread receives the boolean change.
To me it seems like you could also use an AsyncTask to handle the threading and that class is easily cancelable .
SimplicityApks said:
First, if you look in the Dokumentation for IntentService, it says that you should not call stopSelf because it is already implemented to do that when there are no intents left. So It really should be easier to use a Service if you want to stop it like that.
If you want to keep using the intent service, I'd instead use a boolean instance variable which is checked in the publishResults method so just let the service do its work, but before it is published in the UI thread check if the dialog was canceled or not. Otherwise because you have two threads you can't be sure when the other thread receives the boolean change.
To me it seems like you could also use an AsyncTask to handle the threading and that class is easily cancelable .
Click to expand...
Click to collapse
I cannot use Asynctask ,as operation could be long.checking the boolean before publish is good idea.I will try this
Sent from my GT-S5570 using XDA Premium 4 mobile app

ArrayList<Integer> 's remove method confusing?

Suppose I added a digit '1' to the arraylist<Integer> which is at position 0.So when I call remove method like this.
array.remove(1);
It gives an exception.although the method remove(object) exists.so I how can I remove the object(integer) by not using the position
Sent from my GT-S5570 using XDA Premium 4 mobile app
arpitkh96 said:
Suppose I added a digit '1' to the arraylist<Integer> which is at position 0.So when I call remove method like this.
array.remove(1);
It gives an exception.although the method remove(object) exists.so I how can I remove the object(integer) by not using the position
Sent from my GT-S5570 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
array.remove(new Integer(1));
SimplicityApks said:
array.remove(new Integer(1));
Click to expand...
Click to collapse
That didn't worked.I am using it like this
Code:
//CopyIds is the arraylist
private BroadcastReceiver Copy_Receiver = new BroadcastReceiver(){
@Override
public void onReceive(Context arg0, Intent arg1) {
// TODO Auto-generated method stub
Bundle b=arg1.getExtras();
if(b!=null){
int id=b.getInt("id");
Integer id1=new Integer(id);
if(CopyIds.contains(id)){
boolean completed=b.getBoolean("COPY_COMPLETED",false);
View process=rootView.findViewWithTag("copy"+id);
if(completed){ rootView.removeViewInLayout(process);CopyIds.remove(id1);}
else{
String name=b.getString("name");
int p1=b.getInt("p1");
int p2=b.getInt("p2");
long total=b.getLong("total");
long done=b.getLong("done");
((TextView)process.findViewById(R.id.progressText)).setText("Copying \n"+name+"\n"+utils.readableFileSize(done)+"/"+utils.readableFileSize(total)+"\n"+p1+"%");
ProgressBar p=(ProgressBar)process.findViewById(R.id.progressBar1);
p.setProgress(p1);
p.setSecondaryProgress(p2);}
}else{
View root=getActivity().getLayoutInflater().inflate(R.layout.processrow, null);
root.setPaddingRelative(10,10,10,10);
String name=b.getString("name");
int p1=b.getInt("p1");
int p2=b.getInt("p2");
root.setTag("copy"+id);
((TextView)root.findViewById(R.id.progressText)).setText("Copying \n"+name);
ProgressBar p=(ProgressBar)root.findViewById(R.id.progressBar1);
p.setProgress(p1);
p.setSecondaryProgress(p2);
CopyIds.add(id);
rootView.addView(root);
}
}
}};
Log says error receiving broadcast.arryindexoutofbounds exception ,size 1 index 1
Sent from my GT-S5570 using XDA Premium 4 mobile app
arpitkh96 said:
That didn't worked.I am using it like this
Code:
//CopyIds is the arraylist
private BroadcastReceiver Copy_Receiver = new BroadcastReceiver(){
@Override
public void onReceive(Context arg0, Intent arg1) {
// TODO Auto-generated method stub
Bundle b=arg1.getExtras();
if(b!=null){
int id=b.getInt("id");
Integer id1=new Integer(id);
if(CopyIds.contains(id)){
boolean completed=b.getBoolean("COPY_COMPLETED",false);
View process=rootView.findViewWithTag("copy"+id);
if(completed){ rootView.removeViewInLayout(process);CopyIds.remove(id1);}
else{
String name=b.getString("name");
int p1=b.getInt("p1");
int p2=b.getInt("p2");
long total=b.getLong("total");
long done=b.getLong("done");
((TextView)process.findViewById(R.id.progressText)).setText("Copying \n"+name+"\n"+utils.readableFileSize(done)+"/"+utils.readableFileSize(total)+"\n"+p1+"%");
ProgressBar p=(ProgressBar)process.findViewById(R.id.progressBar1);
p.setProgress(p1);
p.setSecondaryProgress(p2);}
}else{
View root=getActivity().getLayoutInflater().inflate(R.layout.processrow, null);
root.setPaddingRelative(10,10,10,10);
String name=b.getString("name");
int p1=b.getInt("p1");
int p2=b.getInt("p2");
root.setTag("copy"+id);
((TextView)root.findViewById(R.id.progressText)).setText("Copying \n"+name);
ProgressBar p=(ProgressBar)root.findViewById(R.id.progressBar1);
p.setProgress(p1);
p.setSecondaryProgress(p2);
CopyIds.add(id);
rootView.addView(root);
}
}
}};
Log says error receiving broadcast.arryindexoutofbounds exception ,size 1 index 1
Click to expand...
Click to collapse
Strange since I don't get any compile time errors (sorry don't have time to test it right now) and that should be the way to do it...
Anyway, if it still doesn't work for you, just manually search for the right index using get().equals in a for loop and remove the element at the right index then... (that's what the remove(Object) method does anyway).
SimplicityApks said:
array.remove(new Integer(1));
Click to expand...
Click to collapse
That works. But why ArrayList is not generified. I would like to use it like:
Code:
arrayList.<Integer>remove(new Integer(1));
It would throw Compiler time Error in case if you pass object of wrong type, which would safe time people like OP.
SimplicityApks said:
Strange since I don't get any compile time errors (sorry don't have time to test it right now) and that should be the way to do it...
Anyway, if it still doesn't work for you, just manually search for the right index using get().equals in a for loop and remove the element at the right index then... (that's what the remove(Object) method does anyway).
Click to expand...
Click to collapse
I solved it
Sent from my GT-S5570 using XDA Premium 4 mobile app

Categories

Resources