Hallo zusammen
Ich habe folgendes Composable in meinem Code:
@Composable
fun Toolbar() {
// Create a boolean variable
// to store the display menu state
var mDisplayMenu by remember { mutableStateOf(false) }
// fetching local context
val mContext = LocalContext.current
// Creating a Top bar
TopAppBar(
title = { Text(stringResource(R.string.app_name)) },backgroundColor = Color(0xFFFFFFFF),
actions = {
// would create a Toast message
IconButton(onClick = {
val intent = Intent(this, LockScreenActivity::class.java)
startActivity(intent)
Toast.makeText(mContext, "Lock app...", Toast.LENGTH_SHORT).show() }) {
Icon(Icons.Outlined.Lock, "")
Nun möchte ich gerne, dass wenn man auf das lock icon klickt, die dazugehörige Activity "LockScreenActivity" gestartet wird. Folgende Fehlermeldung erhalte ich jedoch bei "val intent = Intent"
None of the following functions can be called with the arguments supplied.
<init>(Context!, Class<*>!) defined in android.content.Intent
<init>(String!, Uri!) defined in android.content.Intent
Ich weiss nicht genau, warum diese Fehlermeldung auftritt bzw. warum es nun noch ein Argument benötigt. Könnte mir bitte Jemand helfen?
Eine Zeile weiter unten bestätigt sich nochmals mein Fehler mit der Meldung No value passed for parameter 'intent'
No value passed for parameter 'intent'
Vielen Dank für jede Hilfe.
#include <stdio.h>
#include <ctype.h>
int main (void)
{
float ans[50];
char que[] [100] = {"1.Which programming language was this program developed for?:\n",
" 2.How do you show text ?:\n",
"3.whats means while loop?:\n"};
char poans [] [100] = {"1. python\n" "2.java\n2" "3.C\n",
"1. printf\n" "2.printd\n" "3.einfach tippen\n",
"1. repeat until death\n" "2.keine Ahnung\n", "3.checks a condition, then executes a block of code if condition is true\n"};
int numberOfque= sizeof(que)/sizeof(que[0]);
char kans [][2] = {'3', '1', '3'};
char guess;
printf("wellcome to the quiz!\n");
for(int i= 0; i < numberOfque; i++)
{
printf("%s\n", que[i]);
for (int j=i * 3; j==(i * 3)+2; j++)
{
printf("%s\n", poans [j]);
}
return (0);
}}