[Solved] “Java is not recognised as an internal or external command” in vs code even though I am trying to use kotlin. I properly set the path also

This error occurs because you have not installed the Java JDK. How to use Kotlin in VS code First you need to install the following programs on your machine Install Java JDK on the computer system Install Kotlin on your computer system VS code install plugin Kotlin Language VS code install plugin Code Runner installation … Read more

[Solved] Java Array.asList error

Assuming your Article class is like below if not please make proper class, class Article{ String id; String article; String description; Article(String id ,String articleName,String description) { this.id=id; this.articleName = articleName; this.description = description; } …….. //your getter/setters are defined here. } Now you should use them in your main class as below, List<Article> articleList … Read more

[Solved] Android call api route every few seconds

Try this declare Timer global Timer timer; add this code inside onCreate() method timer = new Timer(); timer.scheduleAtFixedRate(new RemindTask(), 0, 3000); // delay in seconds create a new class like this private class RemindTask extends TimerTask { @Override public void run() { runOnUiThread(new Runnable() { public void run() { // call your method here getImageFromApi(); … Read more

[Solved] getting error in URL why? [closed]

The error message tells you the problem: Exception in thread “main” java.net.MalformedURLException: no protocol: upload1.something.com at java.net.URL.<init>(URL.java:586) at java.net.URL.<init>(URL.java:483) at java.net.URL.<init>(URL.java:432) at Ideone.main(Main.java:12) Ideone You are missing the protocol. solved getting error in URL why? [closed]

[Solved] I have created an android app in eclispe. when i install i got two apps installed

<?xml version=”1.0″ encoding=”utf-8″?> <manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.zacter” android:versionCode=”1″ android:versionName=”1.0″ > <uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”18″ /> <application android:allowBackup=”true” android:icon=”@drawable/ic_launcher” android:label=”@string/app_name” android:theme=”@style/AppTheme” > <activity android:name=”com.zacter.MainActivity” android:label=”@string/app_name” android:screenOrientation=”portrait” > <intent-filter> <action android:name=”android.intent.action.MAIN” /> <category android:name=”android.intent.category.LAUNCHER” /> </intent-filter> </activity> <activity android:name=”com.zacter.SettingsActivity” android:label=”@string/title_activity_settings” android:parentActivityName=”android.app.LauncherActivity” > <meta-data android:name=”android.support.PARENT_ACTIVITY” android:value=”android.app.LauncherActivity” /> </activity> <activity android:name=”com.zacter.Boostram” android:label=”@string/title_activity_boostram” > </activity> </application> </manifest> 0 solved I have created … Read more

[Solved] Spiral Number pattern in java [closed]

Finally I found Solution. Like This //you can change Input No Here. int INPUT = 5; //statics for direction type final int LEFT = 1; final int DOWN = 2; final int RIGHT = 3; final int UP = 4; //Grid Array int[][] patt = new int[INPUT][INPUT]; //initial position int x = 0; int y … Read more

[Solved] How to resolve ClassCastException: java.lang.String cannot be cast exception

You are trying to change List<String> to List<tcmb> and problem lies here public static List<tcmb> getList(Activity a){ // your code // List<String> itemList = new ArrayList<String>(); itemList.addAll(Arrays.asList(itemWords)); dovizList = (List)itemsList; Log.d(TAG, “getValuestcmb: ” + dovizList.size()); return dovizList; Also, I don’t understand, what exactly you are trying to achieve here. List<String> itemsList = new ArrayList<String>(); dovizList … Read more

[Solved] How to make an inner class

I will try to explain it to you without code, since I think you should learn from yourself. You have an array table1 that can only have an element in position 0. You need to give a value to that position like this: table1[0] = new Tables(); now it depends on the complexity you have … Read more

[Solved] java string to class and call mathod

First you have to know the name of the package containing the class. If you know it, you can try the following: String className = packageName + “.Test”; Class cls = Class.forName(className); cls.getMethod(“main”, String[].class).invoke(null); Note that, if the class is in (default) package then you can use “Test” as className without the package name. 2 … Read more

[Solved] Java formatting a arraylist

I tried to guess what exactly you’re trying to achieve. Assuming you’ve got an ArrayList containing Strings, the following code will probably do what you want to achieve (use the method updateList to change an ArrayList that looks like your first example into an ArrayList that looks like your second example): import java.util.ArrayList; import java.util.regex.Pattern; … Read more

[Solved] Why my Model class, data is incorrect?

The problem is about access modifiers which change the fields class behaviour . You are making confusion with class instance variable and class variable . Case 1 (instance variable ) public class DataMasterList { private String masterCode; public DataMasterList() { // TODO Auto-generated constructor stub } public String getMasterCode() { return this.masterCode; } public void … Read more