Android: this.getApplication () возвращает Нулевого указателя

Я подразумеваю, что Вы включаете некоторый код для вещей, необходимо сделать функцию вызываемой, когда связано с ключом - вещи как получение аргумента от CTRL-u.

Взглянули на CTRL-h f interactive для деталей:

    interactive is a special form in `C source code'.
    (interactive args)

    Specify a way of parsing arguments for interactive use of a function.
    For example, write
      (defun foo (arg) "Doc string" (interactive "p") ...use arg...)
    to make ARG be the prefix argument when `foo' is called as a command.
    The "call" to `interactive' is actually a declaration rather than a function;
     it tells `call-interactively' how to read arguments
     to pass to the function.
    When actually called, `interactive' just returns nil.

    The argument of `interactive' is usually a string containing a code letter
     followed by a prompt.  (Some code letters do not use I/O to get
     the argument and do not need prompts.)  To prompt for multiple arguments,
     give a code letter, its prompt, a newline, and another code letter, etc.
     Prompts are passed to format, and may use % escapes to print the
     arguments that have already been read.
12
задан Alexander Farber 21 November 2018 в 08:56
поделиться

1 ответ

You need the update application tag to AndroidManifest.xml with your class name, which is extended from Application, with proper package name.

<application android:name=".AppObject">


As per Application tag google docs, Base class for those who need to maintain global application state. You can provide your own implementation by specifying its name in your AndroidManifest.xml's tag, which will cause that class to be instantiated for you when the process for your application/package is created.

here

4
ответ дан 2 December 2019 в 06:26
поделиться
Другие вопросы по тегам:

Похожие вопросы: