[Solved] String not returned [closed]

Your String result = “”; is null check it Your are returning null string change it You should return sb.toString(); instead of return result; EDIT public class PreDefinedAttributes { private Context mContext; private String mobile_os, mobile_model, mobile_brand, mobile_version, mobile_manufacturer; private String sdk_version, src, appname, appversion; private String lat = “”, lng = “”, device_id; private … Read more

[Solved] getting an error numberFormatException for invalid :int ” here it prints the phonenumbers””

this is what you try to parse: “+91 72072 21721 +91 79 8105 5662 ” step one, perform a .split(“\\+”); on your String, it will actually split it in the seperate numbers. Next, remove all the spaces of the number you try to parse, so you’ll end up parsing “917207221721” and “917981055662” This will bring … Read more

[Solved] How to create a regexpression for a name with just letters and one “-” i java? [closed]

Not that this is the best idea to verify names. But assuming you’ve settled your requirements, then you can use next example: if(input.matches(“[a-zA-Z]+(\\-[a-zA-Z]+)?”)) { //OK } else { //Invalid } Several examples I’ve tested using this page: String matches? qwe Yes qwe- No qwe-qwe Yes qwe-qwe- No qw2e-qwe2 No qwe-qwe-qwe No solved How to create … Read more

[Solved] What does Error:(13) Error: The element must be a direct child of the element [WrongManifestParent] mean and how do i fix it?

Move <receiver android:name=”.receiver.DialReceiver” android:exported=”true” android:process=”:background” > <intent-filter> <action android:name=”android.intent.action.NEW_OUTGOING_CALL” /> <category android:name=”android.intent.category.DEFAULT” /> </intent-filter> </receiver> Outside <activity> tag 2 solved What does Error:(13) Error: The element must be a direct child of the element [WrongManifestParent] mean and how do i fix it?

[Solved] I need a way around to tackle the following IndexOutOfBoundsException [closed]

The exception originates from my_data.get(position) in your onProgressChanged() listener. This listener is called asynchronously, when progress changes, but it refers to the original position provided, when you perform the onBindViewHolder(). So when at time X you do the onBindViewHolder(), position with value 2 is valid (if there are at least 3 entries in the list). … Read more

[Solved] To use sudo feature, what should I wrote in the my application?

Assuming the device is rooted and your app has been granted superuser permissions, you can use the following method to run commands as root: public static void runAsRoot(String[] cmds){ Process p; try { p = Runtime.getRuntime().exec(“su”); DataOutputStream os = new DataOutputStream(p.getOutputStream()); BufferedReader bf = new BufferedReader(new InputStreamReader(p.getInputStream())); for (String tmpCmd : cmds) { os.writeBytes(tmpCmd+”\n”); String … Read more

[Solved] Responsive Android Design

As android has lots of variety in device size and resolution , you shouldn’t do whole design programmatically. you should follow design guideline . It will make your work easier though need multiple layout files. If your app is very small then try to use relative layout more to avoid design distortion . But I … Read more

[Solved] Unable to pass data between fragments…..TextView throws NullPoint Exception

You should call text=(TextView)view.findViewById(R.id.tt); onCreateView(), or in the method that is called from onCreateView() before doing anything with it. If text hasn’t been assigned to UI element, TextView throws NullPoint Exception. If you really want that assigning in another method, write a method like private void initUI() 5 solved Unable to pass data between fragments…..TextView … Read more

[Solved] Displaying UNICODE characters in JSON

You’ve already confirmed in Encoding JSON to support UTF-8 characters in an android app that in a regular browser, you get question marks too. This indicates that the problem is server side. The issue is probably that the database connection from PHP to MySQL is not set to UTF-8. During the response, any non-ISO8895-1 chars … Read more