public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup layoutRoot = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_data_form_schema_setup, container, false); RadDataForm dataForm = new RadDataForm(Activity); String json = LoadJSONFromAsset ("PersonExtended.json"); try { JSONObject jsonObject = new JSONObject (json); dataForm.SetEntity(jsonObject); String schema = LoadJSONFromAsset("PersonSchema.json"); JSONObject jsonSchema = new JSONObject(schema); DataFormMetadata metadata = new DataFormMetadata(jsonSchema); dataForm.SetMetadata(metadata); } catch(JSONException e) { Log.Error ("json", "error parsing json", e); } layoutRoot.AddView(dataForm); return layoutRoot; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup layoutRoot = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_data_form_schema_setup, container, false); RadDataForm dataForm = new RadDataForm(Activity); String json = LoadJSONFromAsset("PersonExtended.json"); try { JSONObject jsonObject = new JSONObject(json); dataForm.SetEntity(jsonObject); String schema = LoadJSONFromAsset("PersonSchema.json"); JSONObject jsonSchema = new JSONObject(schema); DataFormMetadata metadata = new DataFormMetadata(jsonSchema); dataForm.SetMetadata(metadata); } catch (JSONException e) { Log.Error("json", "error parsing json", e); } layoutRoot.AddView(dataForm); return(layoutRoot); }