Click here to Skip to main content
15,885,309 members
Home / Discussions / Android
   

Android

 
AnswerRe: code android multiple table with insert, delete, update Pin
Richard MacCutchan17-Oct-16 7:54
mveRichard MacCutchan17-Oct-16 7:54 
AnswerRe: code android multiple table with insert, delete, update Pin
David Crow17-Oct-16 10:21
David Crow17-Oct-16 10:21 
GeneralOT Pin
Eytukan2-Dec-16 0:37
Eytukan2-Dec-16 0:37 
GeneralRe: OT Pin
David Crow2-Dec-16 5:52
David Crow2-Dec-16 5:52 
GeneralRe: OT Pin
Eytukan3-Dec-16 16:46
Eytukan3-Dec-16 16:46 
QuestionError Collection is of a fixed size Pin
Member 1129526527-Sep-16 16:13
Member 1129526527-Sep-16 16:13 
AnswerRe: Error Collection is of a fixed size Pin
Richard MacCutchan27-Sep-16 21:36
mveRichard MacCutchan27-Sep-16 21:36 
AnswerRe: Error Collection is of a fixed size Pin
Richard Deeming28-Sep-16 2:40
mveRichard Deeming28-Sep-16 2:40 
The MiLista parameter is a fixed size list - most likely an array.

You'll need to convert the parameter to a standard list. You can either do that unconditionally:
C#
public ListaCriteriosAdapter(Context context, IEnumerable<Criterio> MiLista)
{
    this.activity = context;
    ListaCriterios = new List<Criterio>(MiLista);
    MiInflanter = (LayoutInflater)activity.GetSystemService(Context.LayoutInflaterService);
}

Or, you can test the parameter to see if you need to convert it:
C#
private static bool IsReadOnlyOrFixedSize<T>(IList<T> list)
{
    if (list.IsReadOnly) return true;
    
    var nonGenericList = list as System.Collections.IList;
    return nonGenericList != null && nonGenericList.IsFixedSize;
}

public ListaCriteriosAdapter(Context context, IList<Criterio> MiLista)
{
    if (IsReadOnlyOrFixedSize(MiLista))
    {
        MyLista = new List<Criterio>(MyLista);
    }
    
    this.activity = context;
    ListaCriterios = MiLista; 
    MiInflanter = (LayoutInflater)activity.GetSystemService(Context.LayoutInflaterService);
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionManage auto update Pin
Andy_Bell26-Sep-16 6:20
Andy_Bell26-Sep-16 6:20 
AnswerRe: Manage auto update Pin
Afzaal Ahmad Zeeshan26-Sep-16 6:50
professionalAfzaal Ahmad Zeeshan26-Sep-16 6:50 
GeneralRe: Manage auto update Pin
Andy_Bell28-Sep-16 10:31
Andy_Bell28-Sep-16 10:31 
QuestionMake a call from my contact list Pin
Member 1275186521-Sep-16 2:04
Member 1275186521-Sep-16 2:04 
AnswerRe: Make a call from my contact list Pin
Richard MacCutchan21-Sep-16 2:30
mveRichard MacCutchan21-Sep-16 2:30 
GeneralRe: Make a call from my contact list Pin
Member 1275186521-Sep-16 20:23
Member 1275186521-Sep-16 20:23 
GeneralRe: Make a call from my contact list Pin
Richard MacCutchan21-Sep-16 22:06
mveRichard MacCutchan21-Sep-16 22:06 
GeneralRe: Make a call from my contact list Pin
Member 1275186521-Sep-16 22:23
Member 1275186521-Sep-16 22:23 
QuestionRe: Make a call from my contact list Pin
David Crow21-Sep-16 6:32
David Crow21-Sep-16 6:32 
AnswerRe: Make a call from my contact list Pin
Member 1275186521-Sep-16 20:27
Member 1275186521-Sep-16 20:27 
QuestionRe: Make a call from my contact list Pin
David Crow22-Sep-16 2:23
David Crow22-Sep-16 2:23 
QuestionAndroid - Information leakage flaw OutputStream Pin
Member 1235809712-Sep-16 21:24
Member 1235809712-Sep-16 21:24 
QuestionRe: Android - Information leakage flaw OutputStream Pin
David Crow13-Sep-16 3:23
David Crow13-Sep-16 3:23 
AnswerRe: Android - Information leakage flaw OutputStream Pin
Afzaal Ahmad Zeeshan13-Sep-16 7:10
professionalAfzaal Ahmad Zeeshan13-Sep-16 7:10 
GeneralRe: Android - Information leakage flaw OutputStream Pin
Member 1235809720-Sep-16 20:56
Member 1235809720-Sep-16 20:56 
GeneralRe: Android - Information leakage flaw OutputStream Pin
Richard MacCutchan20-Sep-16 22:16
mveRichard MacCutchan20-Sep-16 22:16 
GeneralRe: Android - Information leakage flaw OutputStream Pin
Member 1235809720-Sep-16 23:46
Member 1235809720-Sep-16 23:46 

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.