Hello,
Im trying to get text from one edittext to another, I want to perform a calculation first and cant convert Editable to int! Can someone please help me with this its drinving me madd!!!
Thanks!
Related
Hi everybody!
I've written a small app that uses a richink control to display a lot of text.
I want to add a simple search capability, but I can't figure out how to scroll the control to the right location. I stream out plain text and my algorithm fineds the character where the search string begins. But I couldn't find any way of determining by how much I should scroll the control.
It also seems the WM_SCROLLCARET doesn't work.
Can any one help me please……
Ok last desperate plea for help, anybody?
Hi, this is my first post so a big hello and I am hoping somebody might be able to help. I have just started Android development on the Galaxy Tab and have hit a major problem. I have created a basic view with various controls but I cannot get the virtual keyboard to come up. I have an EditText box and and AutoCompletingText box but neither work. If I select the EditText box (using my finger) you see a red line appear around the edge which I assume is indicating focus. However, the keyboard does not appear and the focus appears to disappear when I remove my finger from the box. I am using the official Galaxy sdk stuff with Eclipse.
Thanks for any assistance.
hztm said:
Hi, this is my first post so a big hello and I am hoping somebody might be able to help. I have just started Android development on the Galaxy Tab and have hit a major problem. I have created a basic view with various controls but I cannot get the virtual keyboard to come up. I have an EditText box and and AutoCompletingText box but neither work. If I select the EditText box (using my finger) you see a red line appear around the edge which I assume is indicating focus. However, the keyboard does not appear and the focus appears to disappear when I remove my finger from the box. I am using the official Galaxy sdk stuff with Eclipse.
Thanks for any assistance.
Click to expand...
Click to collapse
Maybe you can post the relevant part of your xml layout file in which you define the edit views and a part of the onCreate() method where you initiate those views.
BTW is there a specific SDK for the Galaxy? Or do you mean the Android SDK.
Hi, I am using the android sdk download from Samsung for the Galaxy tab and I am directing the program directly to the device rather than an emulator
I have the following in my main.xml file:
<EditText
android:id="@+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="30px"
android:layout_y="700px"
android:text="Hello"
android:inputType="text"
/>
I have the following onCreate.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
factoids();
}
The field is displayed on the screen fine. If I select it with my finger then it is surrounded in blue as if it has got the focus. As soon as I remove my finger the blue focus disappears and the keyboard is never displayed. I normally program on PC and am slowly learning android / java so I expect I have something wrong but really not sure where to look now. Thanks for your assistance.
Yes, nothing wrong with this piece of code. Where do you instantiate the EditText? Maybe something is going wrong there.
Normally one instantiates a widget in the onCreate method; bind it to a variable so one can actually do something with it. In your case this would be:
Code:
EditText txtBox; (Define it in your class so it has full scope)
txtBox = (EditText) findViewById(R.id.EditText01);
Have you tried your own piece of code? Try it. Temporarily remove the factoids() call and it should run perfectly with a keyboard poping up in the editext box. If not there's something wrong with the sdk.
Hi,
Thank you very much indeed for your assistance and I have just managed to get it working. All I have done is copied the program to a new project with a new name and it is working. I have been programming VB.NET and C for years and always assume that it is me that has got it wrong so I must have damaged something in the original program.
Anyway, thanks again for your assistance.
Hi there, long time lurker first time poster here!
Slowly getting into android but i really cant get my head around the layouts. I would love to be able to use the AbsoluteLayouts but that isn't a good idea anymore.
Basically after some work i have managed to get a gallery working at the top of the screen. I want my app to look like this in essence: Ok can't post outside links at the moment, fair enough. Think of the android market. Icons to the left and a bit of information for each app next to it and a buy button on the right.
However i have no idea where to start off. Since i have the gallery already i have no idea how i can add things underneath it without screwing anything up.
Can anyone help? Thanks in advance!
Sorry to bump but the issue has changed, I have built an app but would like like the text to be besides the icon. Any chance someone can help? Using a linear layout.
http://img263.imageshack.us/i/sellscreen.jpg/
RED_ said:
Sorry to bump but the issue has changed, I have built an app but would like like the text to be besides the icon. Any chance someone can help? Using a linear layout.
http://img263.imageshack.us/i/sellscreen.jpg/
Click to expand...
Click to collapse
Are you using a List View? Looks like one.
How do you build up your content for the list?
In my view the best solution for your problem would be:
- Use a ListView
- Build your own ListAdapter (drived from BaseAdapter for example)
The Adapter builds the view for each item (or recycles an already built up view, the ListView handles that).
The view for each item would be a horizontal oriented LinearLayout with two items (the image and the text) and the adapter fills the layout with the information of the current item.
For better layout handling I would define the layout for the items in an extra xml file and use the LayoutInflater-Service inside the Adapter (if a view has to be built).
Hope this helps and points into a helpful direction
Devmil
Thanks for replying, managed to find a solution in the end without using ListView. Thought about moving to a RelativeLayout as its more effcient but as my app is very small anyway in the end i've just gone and used nested LinearLayouts with a textview and imageview in each one.
Ridiculously simple when you look back on it.
I was actually going to use this tutorial which does what you explained i think: http://www.anddev.org/iconified_textlist_-_the_making_of-t97.html but it left me with a force close error so that went out the window.
Hello! i have started making an app for android, and im really really a beginner. however, i got the app working (its a soundboard) but i would like a info screen to pop up when you start the app. i think its really easy to do, but i totally have no idea of how to doing it... can someone please help me?
bump... can someone help me quick with this minimal problem...
OK, this should be pretty simple.
Create a boolean value in the shared preferences, let's call it firstRun. In onCreate() you will check whether this value exists in the preferences. If it does not (or if it's set to true), you know it's the first run and you can show a dialog and set the value to false. If the value exists and is set to false (once you access the value for the first time it will automatically be created in the preferences), then you won't show anything as it is not the first run.
Showing a changelog is just an extension of this process.
Hello Guys, I'm a newbie in app development so help me with this (simple) query.
I have an activity with 4 text box asking for user input (name, place, date, time) . Now how to combine these data into a table in another activity.
PS: I have included exit button in main activity. Is it ok or should I include exit option in action bar menu only? Also what is the java function to exit the app?
Sent from my Xperia Mini using Tapatalk 2
ariftwister said:
Hello Guys, I'm a newbie in app development so help me with this (simple) query.
I have an activity with 4 text box asking for user input (name, place, date, time) . Now how to combine these data into a table in another activity.
PS: I have included exit button in main activity. Is it ok or should I include exit option in action bar menu only? Also what is the java function to exit the app?
Click to expand...
Click to collapse
Hi,
You can easily get a Table with the TableLayout, where in each TableRow you would put two EditTexts. In Android you usually don't need to put an edit button in the layout unless you have a service running or so since there is the back button to easily exit. The Java code to exit would be calling this.finish() from the activity.
SimplicityApks said:
Hi,
You can easily get a Table with the TableLayout, where in each TableRow you would put two EditTexts. In Android you usually don't need to put an edit button in the layout unless you have a service running or so since there is the back button to easily exit. The Java code to exit would be calling this.finish() from the activity.
Click to expand...
Click to collapse
Thanks for your suggestion, but I want all the four editText in a single row. How to do it,? Or is there any detailed tutorial?
Sent from my Xperia Mini using Tapatalk 2
ariftwister said:
Thanks for your suggestion, but I want all the four editText in a single row. How to do it,? Or is there any detailed tutorial?
Click to expand...
Click to collapse
You can find a tutorial on the TableLayout here. But if you just want one row, it's easier to just use a LinearLayout with equal weights for each View. If you want to reuse this layout for another activity, put it in a Fragment!
SimplicityApks said:
You can find a tutorial on the TableLayout here. But if you just want one row, it's easier to just use a LinearLayout with equal weights for each View. If you want to reuse this layout for another activity, put it in a Fragment!
Click to expand...
Click to collapse
Thanks but Actually I'm building an app to keep track all the user's debt. So I want to display the debts in a tabular view. It can be single or multiple varying with every user. So what should I use here?
Also how to place the data got from 4 different edittext as single object into another activity?
Sent from my Xperia Mini using Tapatalk 2
ariftwister said:
Thanks but actually I'm building an app to keep track all the user's debt. So I want to display the debts in a tabular view. It can be single or multiple varying with every user. So what should I use here?
Also how to place the data got from 4 different edittext as single object into another activity?
Click to expand...
Click to collapse
You may want to have a look at the samples of the TableFixHeaders library here to do your Layout. Remember putting it in a separate Fragment in case you want to reuse in another activity.
For data passing you need to put it as extra into the Intent you're starting the second activity with. The data structure you use depends on what you want to do. I recommend dropping everything into a new Bundle and pass that on, that way you can also save/restore when rotating. But if you have only the same data like 4 Strings or 4 doubles you could also directly put it as an array extra with intent.putDoubleArrayExtra or putStringArrayExtra