我的應用程序工作正常。突然之間,我意識到當我嘗試登錄並使用Facebook註銷時出現此錯誤。在我的應用程序中,當我通過Faceboook登錄時,它從Facebook登錄頁面驗證通過成功頁面頁面。類型參數名稱:類型不是從java類型派生的。 - Xamarin android
在成功頁面,用戶點擊繼續,當我點擊繼續,我得到的錯誤
類型參數名:類型不從Java類的。 。
應用崩潰並重新啓動後,我看到,用戶在 被記錄當我退出過,也得到了同樣的錯誤
類型參數名:類型不是從派生java類型。
該應用程序崩潰,但用戶註銷。我搜查了其他相關的問題,但沒有人能幫助我。
這是什麼造成的?
public class successPage : Activity
{
Button button;
TextView textViewActivity;
FirebaseAuth mAuth;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.successPage);
button = (Button)FindViewById(Resource.Id.button);
textViewActivity = (TextView)FindViewById(Resource.Id.textView);
mAuth = FirebaseAuth.Instance;
button.Click += onBtnClick;
//textViewActivity.Text = user.DisplayName;
// Create your application here
}
private void onBtnClick(object sender, EventArgs e)
{
Intent success = new Intent(this, (typeof(EventNews)));
StartActivity(success);
}
}
Intent success = new Intent(this, (typeof(EventNews)));
EventNews
public class EventNews : BaseActivity, IValueEventListener
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
FrameLayout content = (FrameLayout)FindViewById(Resource.Id.content_frame);
LayoutInflater.Inflate(Resource.Layout.EventNews, content);
//initializing firebase
user = FirebaseAuth.Instance.CurrentUser;
toolbarMain = (Android.Support.V7.Widget.Toolbar)FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolBar);
SetSupportActionBar(toolbarMain);
TextView toolbarName = (TextView)FindViewById(Resource.Id.counter_text);
}
}
public override bool OnCreateOptionsMenu(IMenu menu)
{
MenuInflater.Inflate(Resource.Menu.top_menus, menu);
var item = menu.FindItem(Resource.Id.search);
var searchview = (Android.Support.V7.Widget.SearchView)MenuItemCompat.GetActionView(item);
searchview.QueryTextChange += (s, e) =>
{
adapter.Filter.InvokeFilter(e.NewText);
};
searchview.QueryTextSubmit += (s, e) =>
{
Toast.MakeText(this, "Searched for: " + e.Query, ToastLength.Short).Show();
e.Handled = true;
};
MenuItemCompat.SetOnActionExpandListener(item, new SearchViewExpandListener(adapter));
return base.OnCreateOptionsMenu(menu);
}
private void Adapter_ItemClick(object sender, int position)
{
}
private class SearchViewExpandListener : Java.Lang.Object, MenuItemCompat.IOnActionExpandListener
{
private readonly IFilterable _adapter;
public SearchViewExpandListener(IFilterable adapter)
{
_adapter = adapter;
}
public bool OnMenuItemActionCollapse(IMenuItem item)
{
_adapter.Filter.InvokeFilter("");
return true;
}
public bool OnMenuItemActionExpand(IMenuItem item)
{
return true;
}
}
public void OnCancelled(DatabaseError error)
{
throw new NotImplementedException();
}
public void OnDataChange(DataSnapshot snapshot)
{
eventNews.Clear();
var items = snapshot.Children.ToEnumerable<DataSnapshot>();
HashMap map;
foreach (DataSnapshot item in items)
{
map = (HashMap)item.Value;
eventNews.Add(new EventNews(item.Key.ToString(),map.Get("Name")?.ToString(), map.Get("Achievement")?.ToString(),map.Get("History")?.ToString(),map.Get("Quote")?.ToString(), map.Get("Ref").ToString()));
}
//list items on listview
rv.SetLayoutManager(new LinearLayoutManager(this));
rv.SetItemAnimator(new DefaultItemAnimator());
rv.SetAdapter(adapter);
mDialog.Dismiss();
}
}
誤差點,這條線棧跟蹤
at Java.Lang.Class.FromType (System.Type type) [0x00012] in <d855bac285f44dda8a0d8510b679b1e2>:0
at Android.Content.Intent..ctor (Android.Content.Context packageContext, System.Type type) [0x00000] in <d855bac285f44dda8a0d8510b679b1e2>:0
at peaceApp.Droid.successPage.onBtnClick (System.Object sender, System.EventArgs e) [0x00002] in /Users/emmnock/Documents/Projects/peaceApp/Droid/successPage.cs:76
at Android.Views.View+IOnClickListenerImplementor.OnClick (Android.Views.View v) [0x00011] in <d855bac285f44dda8a0d8510b679b1e2>:0
at Android.Views.View+IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_v) [0x0000f] in <d855bac285f44dda8a0d8510b679b1e2>:0
at (wrapper dynamic-method) System.Object:579ed970-959a-4157-8d2c-b00f36f55fa7 (intptr,intptr,intptr)
這條線上的錯誤點'Intent success = new Intent(this,(typeof(EventNews)));' – Switz
你可以添加'EventNews'是什麼嗎? –
第二個參數需要一個類,我認爲,而不是一個類型。 –