[android-developers] how to scrolling two textviews

2012-02-22 Thread Richard Sámela
I implemented textview which is automaticly scrolling by theese lines
of code:

android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"

this work perfectly. but there is focusable attribute important
because if I remove both of focusable attributes so textview doesn't
scroll.
But my problem is that textview is scrolling only if it has a focus.
And I would like to implement two textviews at one screen. There is a
problem when I set focusable attribute to both of texviews. focus get
only the first textview and that's the reason why is scrolling only
first textview.

Please help me how to achieve that both of the textviews will be
scrolling at same time.
Thank you very much for your help.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] how to handle connection lost using Media player?

2011-12-15 Thread Richard Sámela
hello,
to play the music stream I use Media player and prepareasync in
backround service. Music is playing and then I lost connection. or
maybe when I reconect from wifi to 3G. Is there any way how to handle
somethink like this?

thank you very much
Richard Sámela

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] change between screens - best practise

2011-09-16 Thread Richard Sámela
hallo,
in my app i have a listview and if i click on item so i start new
activity by intent to show details of an item. i would like to do it
that it will be possible scrolling in detail activity. there i
implement GestureDetectr.OnGestureListener and when i scroll from
right to left i would like to see detail window of next item from list
activity. And my question is what is the best practise? should I start
new activity by intent? or when i start detail activity fo the first
time should i create somethink like view flipper of eg 18 items from
listview and in the detail activity flipping the views? what is the
trick how can i code my app to interact with user by scrolling from
side to side. not from top to botton.
and how is the best way how to implement it because count of item
could be 20 and more and every detail view for each item should
contains probably 20 textviews.

thank you very much for each advice

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Watch video in WebView problem

2012-05-13 Thread Richard Sámela
Hallo,

I have implemented my app by TabActivity. There is a WebView as a root
of layout in the one on the child activities. Orientation of all
activities of project is setup to portrait in mainfest file.
Everything works well, but problem occured if I double click on
youtube video -> change orientation of screen to landscape and open
video fullscreen. And after the video finish playing so all screens,
activities.. all has changed orientation to landscape as fullscreen
video. it's not appropriate for me. My application should work only
with portrait screen orientation. And I would like to ask you maybe
how to disable play video fullscreen in webview or how to change
screen orientation back to portrait after the video finishes.

Or if you can give me some other advices, I'll be very thankful to
you.
Here is example of declaration my WebView:

web = (WebView) findViewById(R.id.webView);
web.getSettings().setJavaScriptEnabled(true);
web.getSettings().setAllowFileAccess(true);
web.getSettings().setPluginsEnabled(true);
web.setWebViewClient(new CustomWebViewClient());
web.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
web.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
web.loadUrl(URL);

thank you very much

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] ArrayList vs ArrayAdapter

2011-02-02 Thread Richard Sámela
HI,
I have a problem with implementation. I use a ArrayList as
class MyRecord is:

public class MyRecord {
 Date date;
 double spotreba;
 int pocet_km;
 double cena;
 String desc;

MyRecord(Date date, double objem, int pocet_km, double liter, String
desc){
this.date=date;
this.spotreba=objem;
this.pocet_km=pocet_km;
this.cena=liter;
this.desc=desc;
}

and in the ListView I have declared ListItem which looks like that:


http://schemas.android.com/apk/res/
android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:paddingLeft="10sp">



  
  
  
  



and my problem is to referenced fields double spotreba and Date date
to two TextViews in the inner LinearLayout. I understand if I had only
strings and it give to adapter. But here I don't understand how to
change my ArrayList to some ArrayAdapter and show it in the
View. can you give me some advice or some tutorial page? Or can you
explain me it how should I continue?

thank you very much
Richard Sámela

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] need help with DatePickerDialog

2011-02-07 Thread Richard Sámela
I have this fields:
private EditText datum;
private int mYear;
private int mDay;
private int mMonth;
private final Context context= this;

and theese listeners:

OnClickListener ocl = new OnClickListener() {

@Override
public void onClick(View v) {
DatePickerDialog.OnDateSetListener callBack = 
new
DatePickerDialog.OnDateSetListener(){

@Override
public void onDateSet(DatePicker view, 
int year,
int monthOfYear, int 
dayOfMonth) {
// TODO Auto-generated method 
stub

mYear=year;mMonth=monthOfYear;mDay=dayOfMonth;
}

};
DatePickerDialog dpd = new 
DatePickerDialog(context, callBack,
mYear, mMonth, mDay);
dpd.show();

datum.setText(Integer.toString(mDay)+"."+Integer.toString(mMonth)
+"."+Integer.toString(mYear));
}
};
datum.setOnClickListener(ocl);


I dont know what is wrong but when I clicked on my datum: EditText so
my app force close.  help me pls to find a mistake.
thank you very much

Richard Sámela

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Change View

2011-02-07 Thread Richard Sámela
hi,
in my app I use method setContentView(resource); and this view
contains only text view with text no items. and by menu and new
activity I create new item. And how to change used View with one
textView to the other View which contains ListView to show my added
item. when I have added item and I call method setContentView again to
set new layout from Resource app force close. how to change layouts
dynamically after adding new item? can someone give me some advice?
thank you very much

Richard Sámela

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Change View

2011-02-08 Thread Richard Sámela
I know how to update my adapter. I extends my adapter and i can get
adapter to the listview. But i was asking if it is possible to call
method setcontentview more times in activity or about best practice
how to switch between views. Now i think that use setcontentview more
times is possble i try to find bug somewhere
Thanks for your reply

Richard Samela

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] ListView with custom items

2011-02-28 Thread Richard Sámela
Hi,
my problem is that I have data in arraylist and I cant get it to
adapter.

I created this adaper in separate class:

public class MyAdapter extends ArrayAdapter{
private ArrayList al;
private LayoutInflater inflater;

public MyAdapter(Context context,int resources, int
textViewResourceId, ArrayList al) {
super(context,resources, textViewResourceId);
this.inflater = LayoutInflater.from(context);
this.al=al;
}
public View getView(int position, View convertView,ViewGroup parent)
{
View row = convertView;
if(row==null){
row = inflater.inflate(R.layout.list, parent, false);
}
TextView spot=(TextView)row.findViewById(R.id.TextView01);
TextView datu=(TextView)row.findViewById(R.id.TextView02);
spot.setText(Double.toString(al.get(position).spotreba));
datu.setText(al.get(position).date);
return row;
}
}

I create adapter in MainActivity like this:

ArrayList al - here I have all my data.  and this is field
of MainActivity extends Activity
ListView lv = (ListView) findViewById(R.id.listik);
adapter = new MyAdapter(this,R.id.listik,R.layout.list,al);
lv.setAdapter(adapter);
when I do this nothing happens. ListView is empty.

in method onCreate I setContentView from resource this:

http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/ll">

  


Aplication run corectly data are alright but I cant display them to
the ListView. please help me find what I do wrong. And I can't find
bug, I have tried a lof of options but nothing helps me.
thank you very much.

Richard Sámela

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: ListView with custom items

2011-03-01 Thread Richard Sámela


On 1. Mar., 01:59 h., TreKing  wrote:
> On Mon, Feb 28, 2011 at 5:53 PM, Richard Sámela wrote:
>
> Have you confirmed that:
> 1 - your array list actually has items and
> 2 - your getView function is being called


I sure that my ListArray contains items of type MyRecord I tried to
write them to Log.d
but I add control Log.d method to getView and nothing happens. So
getView method isn't being called.
But it should be overided method and should be funkction automaticly,
shouldn't be? or why getView doesn't work? is there some mistake in
code? because I make this method by tutorial...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: ListView with custom items

2011-03-01 Thread Richard Sámela


On 1. Mar., 10:30 h., Kostya Vasilyev  wrote:
>
> Two ways to fix it:
>
> - Get rid of "al" in your subclass, pass the data array to ArrayAdapter,
> get data items from it as needed (using getItem());
>
> - Continue using "al" in your subclass, but then don't use ArrayAdapter,
> extend BaseAdapter instead.


Oh, thank you very much your help was very useful because a spend a
lot of time with this problem and now it is solved :)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] switch between two or more screens

2010-12-15 Thread Richard Sámela
Hallo,
I would like to ask question about my app. I would like to make app
which contains two or more Views (something like windows or screens).
So on start app I create for example 3 intents to 3 different Views
with 3 different layouts. In my basic layout I have 3 buttons and each
button called some intent. If I am right it should be correct. and I
switch something different View. but what if I want to get back to my
basic View? sould I send  to method any reference or something like
this?

I need some advice how can I solve my problem. Simply OnStartApp I
need create e.g. 3 different screens (it should be Activites if i'm
right) and then I would like to swith between them. only switch, no
destroy and then create it new.
can anybody help me with problem??
Thank you very much.

Richard Sámela

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] JNI working

2011-01-11 Thread Richard Sámela
Hi,
I would like to know something about JNI. How it works in android?
does it work on all devices? does it work on tablest with android?
I want to use toolkit in C++ programing language.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: JNI working

2011-01-12 Thread Richard Sámela
hmm I don't know but am I right if I think that the code written in C+
+ will be the same for both of processores. And OS will be the same
too. And as I know the android app is compilated by virtual machine
which is running under the android. So I don'tunderstand why deppends
on type of processor. But it could be true, I'm only asking.
thanks for answers

On 12. Jan, 01:28 h., John Gaby  wrote:
> I believe that there are devices (e.g. some tablets) out there that
> use MIPS processors rather than ARM.  Correct me if I am wrong, but I
> do not believe that code compiled for an ARM device will work on a
> MIPS device.
>
> On Jan 11, 11:35 am, Kumar Bibek  wrote:
>
>
>
>
>
>
>
> > Yes, It will work on all devices...
>
> > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com
>
> > On Wed, Jan 12, 2011 at 1:03 AM, Richard Sámela wrote:
>
> > > Hi,
> > > I would like to know something about JNI. How it works in android?
> > > does it work on all devices? does it work on tablest with android?
> > > I want to use toolkit in C++ programing language.
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.> > To post to this group, send email 
> > > toandroid-develop...@googlegroups.com
> > > To unsubscribe from this group, send email to> 
> > > >android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] EditText with Cross

2011-01-12 Thread Richard Sámela
Hi,
I saw an app where was EditText and if you put some text into EditText
there was a Cross Button (or something like that) on the left side.
And if I click on this Button the text from EditText was deleted. Can
you help me or explain me how to to this? I would like to use EditText
with the same effect.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: EditText with Cross

2011-01-12 Thread Richard Sámela
Yes that I know but I would like to do that the Button will be inside
of EdiText. The Button will be a little bit like a cover of EditText.
Is it possible to set the Button position to be above the EditText??
thanks for answering.

On 12. Jan, 17:49 h., Kumar Bibek  wrote:
> It might just be a regular button beside the EditText. And I guess that's
> very simple to implement.
>
> Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com
>
> On Wed, Jan 12, 2011 at 10:15 PM, Richard Sámela wrote:
>
>
>
>
>
>
>
> > Hi,
> > I saw an app where was EditText and if you put some text into EditText
> > there was a Cross Button (or something like that) on the left side.
> > And if I click on this Button the text from EditText was deleted. Can
> > you help me or explain me how to to this? I would like to use EditText
> > with the same effect.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.> To post to this group, send email 
> > toandroid-develop...@googlegroups.com
> > To unsubscribe from this group, send email 
> > to>android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] MapView - infowindow

2011-04-12 Thread Richard Sámela
Hallo,
pls give me some advice how can I implement some infowindow do MapView
in my app. I think something like this:
[img]http://feromakovi.tym.sk/infowindow.png[/img]
or original infowindow, the same as is used in google maps app, in
which is for example my name.
please give me some advice or link me to some tutorial.
thank you very much.

Richard Sámela

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: I hate threads, help please.

2011-03-06 Thread Richard Sámela
Very great article about threads is here:
http://www.bogotobogo.com/Android/android22Threads.html

I learnt threads from there and now I think I understand it. try to
visit this page.

On 6. Mar., 23:31 h., brian purgert  wrote:
> I have a main thread that controls the drawing on the canvas, but i want
> another thread that is just a bunch of true or false statements that detects
> if an event happened.
> So can some one show me how to make a simply low priority thread. That
> starts when the activity starts. It would be much appreciated if someone who
> has done it before could show me because, the android doc examples are
> confusing me

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Connection problem

2011-03-07 Thread Richard Sámela
HI,
I read developer.android.com and via class connectivitymanager should
I get network state info. I want to know is my mobile connected to the
internet? I try it like this but it doesn't work. can you help me what
I am doing wrong? I have this in onCreate method.

ConnectivityManager cm = (ConnectivityManager)
getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo ni = cm.getActiveNetworkInfo();
boolean variable = ni.isConnected();
if (variable) Toast.makeText(this, "I'm connected",
Toast.LENGTH_SHORT).show();

thank you very much
R.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] invisible part of layout

2011-03-10 Thread Richard Sámela
hallo,
my issue is that I have a layout and at the bottom of layout I have a
EditText like this:



And it should be like TextArea or some edittext where I can write more
than one line and if text is in the end so it shoud get to the new
line. But no scroll to the right. And problem this sdittext is at the
bottom and if I click on it so virtual keyboard cover it. And I cant
see what I'm writting. if I maybe made a mistake I can't see it and
edit the writen text is very difficult. so I think that the right way
is when keyboard discovered, so little eidittext will be above at the
top of keyboard. or something else but I should see what I put to the
edittext.
thanks a lot

R.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en