How to import an external library in Android studio?

What is the syntax for changing a text box value in Java using Eclipse and the Android SDK?

  • I'm writing a calculator app for android in Java for a school project. I'm using Eclipse along with the Android SDK. I have a separate xml layout file (main.xml). I'm familiar with programming in C# in Visual Studio and I have been told that Java is very similar. However this is sort of an independent study type class so I unfortunately don't have a book or any training with Java. I'm trying to edit the value of a text box but I'm unsure of the syntax and I've been searching online and can't find anything on it. I'm used to doing: myTextBox.text = "test"; in C# but that doesn't appear to work in Java. In my main.xml I have: android:id="@+id/dispPanel" android:layout_width="fill_parent" android:layout_height="75dp" android:inputType="numberDecimal" android:textSize="30dp" I had thought in my CalculatorActivity.java file I could just add: dispPanel.text = "22.0"; or something similar. So I guess my question is, what is the proper syntax in java to do this? Is there anything special that I need to do in order to make sure the compiler in Eclipse knows that I am talking about dispPanel in the main.xml file other than the code that Eclipse has generated within my CalculatorActivity.java file (as seen below): package calculator.namespace; import android.app.Activity; import android.os.Bundle; public class CalculatorActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } Do I need to add any libraries also? I know this is probably such a basic question but I'm pretty lost right now. Also if you know of any good sites for general java syntax it would be great if you could pass them on. Thank you so much for your help in advance.

  • Answer:

    There is no available syntax for editing the text box value; sorry about that.... Good luck!

fawkesth... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.