[Solved] Dynamic inflating gives me a nullexception

[ad_1] I’ve change the type of view to resolve the problem: I had… //View newGratLayout = LayoutInflater.from(getActivity()).inflate(R.layout.albaran_invoices_row, ll_invoices_layer, false); And now I had… RelativeLayout newGratLayout = (RelativeLayout)getActivity().getLayoutInflater().inflate(R.layout.albaran_invoices_row, null); //rl_albaran_invoices_row Thank for the people how try to help me. [ad_2] solved Dynamic inflating gives me a nullexception

[Solved] Google Maps Api v2 Android Error

[ad_1] Because version 2 of the Google Maps Android API requires OpenGL ES version 2, you must add a element as a child of the manifest element in AndroidManifest.xml: <uses-feature android:glEsVersion=”0x00020000″ android:required=”true”/> This notifies external services of the requirement. In particular, it has the effect of preventing Google Play Store from displaying your app on … Read more

[Solved] Can you draw a google static map to a canvas after you download it?

[ad_1] As i mentioned in comments, You could actually reuse the bitmap. You could also draw on canvas directly for date and time since the datetime bitmap will consume 160000 bytes i.e 156kb. I have not tested the code. This is just a suggestion. class TheTask extends AsyncTask<Void, Void, Bitmap> { File mediaFile = new … Read more

[Solved] App crashes in Android Studio using Kotlin

[ad_1] You forget to typecast your TextView : Try with below code : val sample_text : TextView = findViewById<TextView>(R.id.sample_text) as TextView Full Code : import android.support.v7.app.AppCompatActivity import android.os.Bundle import android.widget.TextView import kotlinx.android.synthetic.main.activity_main.* class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val sample_text : TextView = findViewById<TextView>(R.id.sample_text) as TextView sample_text .text = … Read more

[Solved] How to use android distanceBetween() method

[ad_1] I am confused how to distinguish starting position and end position, as location manager gives you the current position and keeps giving back new position every 5s You already have the code available to get a new location, so you need to save the old Location and calculate distance to new location during every … Read more

[Solved] passing json reply from webservice to variables

[ad_1] You are getting response in JSONObject and you are trying to get it in JSONArray.. thats why you are getting error.. Try this way… try { JSONObject result = new JSONObject(response); if(data.has(“ValidateLoginResult”){ JSONArray array = result.getJSONArray(“ValidateLoginResult”); for (int i = 0; i < array.length(); i++) { JSONObject obj = array.getJSONObject(i); String ErrorMessage= “”+obj.getString(“ErrorMessage”); String … Read more

[Solved] webview app permission for capturing images using camera and uploading images from gallery

[ad_1] Add in Manifest.xml: <uses-permission android:name=”android.permission.READ_EXTERNAL_STORAGE” /> <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” /> For android versions higher than M you have to ask for permissions, I’m referring to this question: Link [ad_2] solved webview app permission for capturing images using camera and uploading images from gallery

[Solved] Change EditText with Button click

[ad_1] In your MainActivity.java: public void onClicknews(View v) { String titel1 = “Trumps brutales Kalkül”; EditText article = (EditText) findViewById(R.id.articlename); String s = article.getText().toString(); Intent intent = new Intent(getApplicationContext(), NewsActivity.class); intent.putExtra(“articalName”,s); startActivity(intent); } In your NewsActivity.java: EditText news = (EditText) findViewById(R.id.news); String newsName = getIntent().getStringExtra(“articalName”); news.setText(newsName ); 0 [ad_2] solved Change EditText with Button click

[Solved] How to use shared preference data in different classes in android?

[ad_1] PREFS_NAME is the value you stored in shared preference. public static final String PREFS_NAME = “MyPrefsFile”; // Restore preferences SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); boolean silent = settings.getBoolean(“silentMode”, false) Look at Restoring preferences Edited:To use it among all classes i.e. setter getter method.Perfect use of OOPS.You can call the value from any class thats … Read more

[Solved] How can I add one month to change into the milliseconds?

[ad_1] I suggest: First, instead of your variables (fields?) year, month, day, hours and minutes just declare private LocalDate date; private LocalTime time; private long milliseconds; (Keep the milliseconds variable since you will want to have your result here.) In onDateSet assign a value to date in this way: date = LocalDate.of(selectedYear, selectedMonth + 1, … Read more