android-studio

Why has my Android app stopped? [duplicate]

安稳与你 提交于 2020-01-07 09:43:33
问题 This question already has answers here : What is a NullPointerException, and how do I fix it? (12 answers) Closed 4 years ago . I make my application in Android Studio. I run this application but the Android app stopped. I make a app with an animation. Here is my source code: AndroidManifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.geven.animation" > <application android:allowBackup="true" android:icon="@mipmap

GradientDrawable with OVAL shape not working inside programatically added Text View

别说谁变了你拦得住时间么 提交于 2020-01-07 09:43:05
问题 I have programmatically added Text View and Button . Code final TextView test = new TextView(getApplicationContext()); test.setText(String.valueOf(counterQuantity)); test.setTextColor(getResources().getColor(R.color.black)); test.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 10); GradientDrawable border = new GradientDrawable(); border.setShape(GradientDrawable.OVAL); border.setStroke(1, getResources().getColor(R.color.black)); border.setCornerRadius(2); border.setColor(getResources().getColor(R

SDK location not found

血红的双手。 提交于 2020-01-07 08:34:06
问题 am new in using react native. I install android studio , nodejs , npm . Then i connect my device to run the app.When running it i get this error could anyone help me How to fix sdk location in my app ? ps: am using linux mint as OS . Thanks for help 回答1: If this is your first build you must define %ANDROID_HOME% path first in the "Environment Variables" Copy path to your sdk folder Open System Properties\Advanced\Environment Variables (search for keyword "environment" for shortcut) Press "New

adding two textViews to the header of the expandable listview

烈酒焚心 提交于 2020-01-07 08:29:08
问题 I'm developing in android studio and I'm trying to use Expandable List View. I want to add another textView to the header of every part means that: I'll have a two textViews on the header of each expendable view. it should look like this how do i do that? i already did the expandable list view but the only thing i have left is to add another textview to the header. the main class extends Activity is looking like this: package com.example.yuliaaa.myapplication; import android.app.Activity;

I can't import Javax.swing

青春壹個敷衍的年華 提交于 2020-01-07 08:08:06
问题 I'm using Android studio. I was trying to import javax.swing. ; for login page so I tried to write sentence to import which is import javax.swing. ;. But nothing happen and the sentence to import despair. Could you please teach me how to fix this problem? 回答1: You are trying to access java swing class which is not a part of android SDK. 回答2: It's an Android app! Why do you want to use things in the Swing framework? It doesn't make sense! If you want to show a JDialog , try creating an

Menu bar in android studio project

本秂侑毒 提交于 2020-01-07 07:41:52
问题 I'm new to Android Studio and I'm having many problems doing a menubar. I have searched for many solutions but they weren't going right. I tried this but I don't know what to do next: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu (Menu menu) { super.onCreateOptionsMenu(menu); //Inflate the menu; this

Menu bar in android studio project

坚强是说给别人听的谎言 提交于 2020-01-07 07:41:02
问题 I'm new to Android Studio and I'm having many problems doing a menubar. I have searched for many solutions but they weren't going right. I tried this but I don't know what to do next: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu (Menu menu) { super.onCreateOptionsMenu(menu); //Inflate the menu; this

Android Studio error message I18n

混江龙づ霸主 提交于 2020-01-07 07:19:29
问题 I got an error message that says: [I18N] Hardcoded string "Today - Sunny - 78/67", should use @string resource. How can this error be resolved? The line of code is: android:text="Today - Sunny - 78/67" 回答1: i18n is an abbreviation for internationalization. Android Studio is just giving you a hint that the way you are setting the text won't allow you to easily translate it. Instead you should put your string in a strings.xml file within the res/values folder: <resources> <string name="my

Android Load Images from Drawable Efficiently

我的未来我决定 提交于 2020-01-07 06:54:08
问题 I'm new to Android development and I've had a lot of difficulty figuring out how to load images efficiently. The short version of my question is as follows: I have some png images in my res/drawable folder. How can I load these images onto an Android device without risking an OutOfMemory error? Here are some more details about my problem and my attempts to fix it: I've written a very simple program that simply displays one image. Here's the code: public class TitleScreenActivity extends

Error in adding external Jar libraries in android studio

Deadly 提交于 2020-01-07 05:39:26
问题 This is w.r.t Android Studio 1.3.2 So when i try to add the Repo from the Import Module->Import Existing Jar,the library is added as a separate module and included in the settings.gradle. After this when I try to use the Jar, I get the message Add Library 'x' to the classpath Once i add this to the classpath,I am able to access the classes however the project does not build with the following error, class Xx cannot be found(Xx belongs to the jar) Is there a work-around to this. I can add the