Click here to Skip to main content
15,899,313 members
Home / Discussions / Android
   

Android

 
QuestionRe: How to add youtube thumbnail in list item ? Pin
David Crow14-Jan-16 6:00
David Crow14-Jan-16 6:00 
AnswerRe: How to add youtube thumbnail in list item ? Pin
Member 1226347721-Jan-16 18:58
Member 1226347721-Jan-16 18:58 
QuestionHow can I get data from WAZE? Pin
Member 1147089810-Jan-16 5:31
Member 1147089810-Jan-16 5:31 
QuestionRe: How can I get data from WAZE? Pin
David Crow10-Jan-16 15:50
David Crow10-Jan-16 15:50 
QuestionStop refreshing List Item-view in ListView in Android Pin
Tirumaleswara Reddy.K4-Jan-16 22:44
Tirumaleswara Reddy.K4-Jan-16 22:44 
AnswerRe: Stop refreshing List Item-view in ListView in Android Pin
Afzaal Ahmad Zeeshan4-Jan-16 23:14
professionalAfzaal Ahmad Zeeshan4-Jan-16 23:14 
GeneralRe: Stop refreshing List Item-view in ListView in Android Pin
Tirumaleswara Reddy.K5-Jan-16 18:31
Tirumaleswara Reddy.K5-Jan-16 18:31 
GeneralRe: Stop refreshing List Item-view in ListView in Android Pin
Tirumaleswara Reddy.K5-Jan-16 22:28
Tirumaleswara Reddy.K5-Jan-16 22:28 
this is my code:
public override View GetView(int position, View convertView, ViewGroup parent)
{
audioId = _messageList[position].Id;
view = inflater.Inflate(Resource.Layout.MessageAudio, parent, false);
ivPlay = view.FindViewById(Resource.Id.ivPlay);
ivPause = view.FindViewById(Resource.Id.ivPause);
seekbar = view.FindViewById(Resource.Id.seekbar);
seekbar.Tag = position;
seekbar.SetOnSeekBarChangeListener(this);

ivPlay.Click += (sender, e) =>
{
playingAudioId = audioId;
playPosition = (int)((ImageView)sender).Tag;
if (ivPlay.Visibility != ViewStates.Visible)
{
player.Pause ();
ivPlay.Visibility = ViewStates.Visible;
ivPause.Visibility = ViewStates.Gone;
}

int startval = msglistview.FirstVisiblePosition;
for (int i = startval, j = msglistview.LastVisiblePosition; i <= j; i++)
{
if (audioId == GetConversationItem (i).Id)
{
view = msglistview.GetChildAt (i - startval);
if (view != null)
{
playChronometer = view.FindViewById (Resource.Id.playChronometer);
ivPause = view.FindViewById (Resource.Id.ivPause);
ivPlay = view.FindViewById (Resource.Id.ivPlay);
seekbar = view.FindViewById (Resource.Id.seekbar);
PlayAudio(audioPath, seekbar.Progress);
ivPause.Visibility = ViewStates.Visible;
ivPlay.Visibility = ViewStates.Gone;
}
}
}
};

public void PlayAudio(string path, int duration)
{
try {
if (path != null && System.IO.File.Exists(path)) {
player = new MediaPlayer ();

if (duration == 0) {
player.SetDataSource (path);
player.Prepare ();
length = player.Duration;
TimeSpan tm = TimeSpan.FromMilliseconds (length);
string fromTimeString = tm.ToString ("mm':'ss");
time = fromTimeString;
run.Run ();
player.Start ();

} catch (System.Exception ex) {
Console.WriteLine("Exception at playing audio:" + ex.Message);
}
}
return view;
}

public void Run ()
{
seekUpdation ();
}

public void seekUpdation()
{
try
{ seekbar.Progress = player.CurrentPosition;
playingSeekDuration = player.CurrentPosition;
seekHandler.PostDelayed(run, 100);
seekbar.Max = player.Duration;

var fileduartion = seekbar.Progress;
TimeSpan result = TimeSpan.FromMilliseconds(fileduartion);
string timeString = result.ToString("mm':'ss");
playChronometer.Text = timeString;
}
catch(System.Exception e)
{
Console.WriteLine (e);
}

}
QuestionRe: Stop refreshing List Item-view in ListView in Android Pin
David Crow5-Jan-16 2:17
David Crow5-Jan-16 2:17 
AnswerRe: Stop refreshing List Item-view in ListView in Android Pin
Tirumaleswara Reddy.K5-Jan-16 18:37
Tirumaleswara Reddy.K5-Jan-16 18:37 
GeneralRe: Stop refreshing List Item-view in ListView in Android Pin
Tirumaleswara Reddy.K5-Jan-16 22:31
Tirumaleswara Reddy.K5-Jan-16 22:31 
AnswerRe: Stop refreshing List Item-view in ListView in Android Pin
Member 123123587-Feb-16 4:24
Member 123123587-Feb-16 4:24 
QuestionAndroid Stack (FIFO,LIFO) in Fragments?? Pin
Gourav Gupta1-Jan-16 17:39
Gourav Gupta1-Jan-16 17:39 
GeneralRe: Android Stack (FIFO,LIFO) in Fragments?? Pin
Richard MacCutchan1-Jan-16 21:24
mveRichard MacCutchan1-Jan-16 21:24 
QuestionRe: Android Stack (FIFO,LIFO) in Fragments?? Pin
David Crow3-Jan-16 15:20
David Crow3-Jan-16 15:20 
AnswerRe: Android Stack (FIFO,LIFO) in Fragments?? Pin
Gourav Gupta3-Jan-16 17:15
Gourav Gupta3-Jan-16 17:15 
AnswerRe: Android Stack (FIFO,LIFO) in Fragments?? Pin
Afzaal Ahmad Zeeshan4-Jan-16 23:38
professionalAfzaal Ahmad Zeeshan4-Jan-16 23:38 
QuestionDrawing dashed line on Android Programmatically Pin
jasonalien23-Dec-15 23:23
jasonalien23-Dec-15 23:23 
QuestionRe: Drawing dashed line on Android Programmatically Pin
David Crow27-Dec-15 16:01
David Crow27-Dec-15 16:01 
AnswerRe: Drawing dashed line on Android Programmatically Pin
Richard MacCutchan27-Dec-15 21:57
mveRichard MacCutchan27-Dec-15 21:57 
Questionandroid bluetooth Pin
Member 1220823016-Dec-15 1:00
Member 1220823016-Dec-15 1:00 
AnswerRe: android bluetooth Pin
Afzaal Ahmad Zeeshan16-Dec-15 3:34
professionalAfzaal Ahmad Zeeshan16-Dec-15 3:34 
AnswerRe: android bluetooth Pin
David Crow17-Dec-15 2:48
David Crow17-Dec-15 2:48 
Questionandroid bluetooth Pin
Member 1220823016-Dec-15 0:56
Member 1220823016-Dec-15 0:56 
AnswerRe: android bluetooth Pin
David Crow16-Dec-15 2:23
David Crow16-Dec-15 2:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.